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.


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.


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