Due to the default fallback
functor(T, x) = (), _ -> x
in Functors.jl, every custom type is considered a leaf (i.e. it has no children) and we have to sprinkle @functor MyType everywhere in Flux and in user code.
We could remove all this boilerplate by having by default what @functor MyType currently does. Then 99% of people could live their life completely unaware of @functor/functor (historically poorly documented and poorly understood) and only use the much clearer trainable(x::MyType) in case they need to customize the parameter collection.
Besides the transition, which I think could be made rather smooth, does anyone see any counterindication in changing the default?
Due to the default fallback
in Functors.jl, every custom type is considered a leaf (i.e. it has no children) and we have to sprinkle
@functor MyTypeeverywhere in Flux and in user code.We could remove all this boilerplate by having by default what
@functor MyTypecurrently does. Then 99% of people could live their life completely unaware of@functor/functor(historically poorly documented and poorly understood) and only use the much clearertrainable(x::MyType)in case they need to customize the parameter collection.Besides the transition, which I think could be made rather smooth, does anyone see any counterindication in changing the default?