Michael Abbott
Michael Abbott
Maybe `@functor T` defines `functor(::Type{T}, x, ::Val)`, and `@functor T trainable=(x,y)` defines that and also `functor(::Type{T}, x, ::Val{:trainable})`. Since it's a weird macro anyway, perhaps it can check for the...
Could just have an alias for the other order: ``` julia> RevArray{N,T} = Array{T,N}; julia> [1,2,3] isa RevArray{1} true ```
> e.g. fmap(f, x, xs...). This would help Optimisers.jl and any other downstream library that have rolled their own fmap variants with functor. Can you sketch how this would work?...
Ok. It might be worth trying to write FluxML/Optimisers.jl#42 using this as a logic stress-test? Although need not hold up this PR I guess. (I am not happy yet with...
We could contemplate having Flux provide an `@functor` which for now calls this one, to ease transitions.
> as I can't think of a use-case in e.g. Optimisers.jl that wouldn't work with either prewalk or postwalk. One thing it wants is the tree equivalent of `map(f, pairs(x))`,...
An alternative would be to print `fftfreq(5, 0.3)`, the constructor. That's like what `zip` does.
It seems that by making your type non-leaf, you have opted in to having Functors traverse into it. What's gained by not doing so? Can you clarify what problem traversing...
I guess " any nodes in x that are === should also be so in x′." is a simple-to-explain policy. Would be nice if the policy for how often `f`...
Now updated with a different rule: * non-leaf objects are cached only if they are mutable (as immutable structs can be perfectly reconstructed). * leaf objects are cached if they...