Closed marcromeyn closed 1 year ago
This PR adds methods like map, filter, walk to our blocks. This makes it easier to transform models. This would enable things like adapters, something like:
map
filter
walk
def llora(module): if isintance(module, (nn.Linear, nn.Embedding)): return LoRALayer(module) return module with_adapters = Block(....).walk(llora)
https://nvidia-merlin.github.io/models/review/pr-1194
Goals :soccer:
This PR adds methods like
map
,filter
,walk
to our blocks. This makes it easier to transform models. This would enable things like adapters, something like: