What does `Flux.@treelike` do?

first-steps
flux

#1

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.


#2

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.


#3

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