Lux.jl icon indicating copy to clipboard operation
Lux.jl copied to clipboard

Rewrite `@layer_map` to use KeyPath from Functors

Open avik-pal opened this issue 1 year ago • 0 comments

The current implementation for https://lux.csail.mit.edu/stable/api/Lux/contrib#Map-over-Layer was written when there was no such functionality in Functors. We can rewrite the @layer_map to use a custom Walk type and KeyPath.

Of course, as a transition, we will still provide a string to the function to avoid a breaking change. From v0.6, we will pass a keypath.

For anyone interested the relevant code is here https://github.com/LuxDL/Lux.jl/blob/main/src/contrib/map.jl

avik-pal avatar May 01 '24 18:05 avik-pal