Michael Abbott
Michael Abbott
Am going to merge this so that master has the new behaviour, but won't rush to tag it. The code here will be changed by #43, but the tests may...
Thanks, I didn't see that, have not followed this package closely. I'm not actually too sure why it requires types to be annotated, rather than the reverse, of recursing into...
Ok. Without going so far, the desirable Base types to handle seem to be * Iterators, like the above issue. These all have default constructors. * Transpose, Adjoint, and maybe...
I think such recursion is the only change needed in Functors for e.g. https://github.com/FluxML/Optimisers.jl/pull/42 (maybe with a few local changes...) to work with transposed shared. Functors already tries to be...
The scheme in FluxML/Optimisers.jl#42 is to keep the first one it encounters as original. The unwrapped Array, not the Transpose if any. (Edit: an example here: https://github.com/FluxML/Optimisers.jl/pull/42/files#diff-3b9314a6f9f2d7eec1d0ef69fa76cfabafdbe6d0df923768f9ec32f27a249c63R205-R212) Optimisers's rules all...
I didn't think about those. You are suggesting that ```julia julia> t = ([10,11], 12); julia> functor(typeof(t), z) ((x = [7, 8], y = 9), Functors.var"#3#4"()) ``` should return a...
One attempt is: ```julia functor(::Type{ NTuple{N}(y) functor(::Type{ getproperty(x, s), L)), y -> NamedTuple{L}(map(s -> getproperty(y, s), L)) ``` I'm not sure the `y -> ...` half is necessary at all....
The gradient of `getindex` calls `similar(x)` to get a fresh array to write into, it needs mutation internally: ```julia julia> similar(SA[1,2]) isa MArray true julia> gradient(x -> x[1], SA[1,2])[1] 2-element...
> why does getindex without ! need mutation? What do you mean by "a fresh array to write into" when we're getting a scalar? On the forward pass, it's indeed...
I'm not really sure, Arrays may be special and weird, but FillArrays (next line) are more surprising... and perhaps one needs `Δ::NamedTuple` here too... It would be nice to have...