What does `Flux.@treelike` do?

What does Flux.@treelike do?

In Flux’s source code, I see a lot of Flux’s layers are defined and then @treelike is called. .E.g. @treelike Dense.

1 Like

IIRC it tells functions like params() to look at the fields of the struct, like Dense.W, so that the optimisers can find the parameters.

2 Likes

If that’s the case then I can help with documentation. Let me dig into the code.

1 Like