Michael Abbott
Michael Abbott
I have forgotten. But one was to decide how unhappy we are about this: > `accumulate!(f, y, x)` will work, silently overwriting y. And in general about hooking on deep...
[fff84b5](https://github.com/JuliaDiff/ChainRules.jl/pull/569/commits/fff84b529fa6dcbebe5f6e12c9546387cdca695e) separates out the Tuple method, for which this way of writing the rule makes more sense. And handles `init` by a separate rule. It is, strangely, much slower than...
Trying a bit to track this down, today, I think the slowdown is just some quirk of Zygote's handling of keywords. So it's not the rule's fault. And anything which...
The remaining test failure is 1.8 on x86: ``` Testing rulesets/LinearAlgebra/structured.jl: [181](https://github.com/JuliaDiff/ChainRules.jl/runs/7934430028?check_suite_focus=true#step:6:184) 170.036836 seconds (119.56 M allocations: 3.781 GiB, 9.09% gc time, 97.04% compilation time) [182](https://github.com/JuliaDiff/ChainRules.jl/runs/7934430028?check_suite_focus=true#step:6:185) Testing rulesets/LinearAlgebra/symmetric.jl: [183](https://github.com/JuliaDiff/ChainRules.jl/runs/7934430028?check_suite_focus=true#step:6:186) terminate...
Can this be merged? It's not the last word, [as noted above](https://github.com/JuliaDiff/ChainRules.jl/pull/569#discussion_r950652872), but it is a step forwards.
Another approach would be, if there are any `..`, to write a generated function which calls the macro with appropriate numbers of entries. Replace `A[i,j,..]` with `A[i,j,b1,b2]` when `ndims(A)==4`, etc:...
Note to self about `@generated`: ``` struct Eval2{A,B} make::A act::B end (e::Eval2)(args...) = e.make(args..., e.act) @generated function gen1(arr) N = ndims(arr) quote # This is a variant of what the...
Further note: that won't work, because `f` needs to `@eval` some expression which is constructed using `N`. What might work is something more like this. Write the body of the...
Xref `fill!` discussion in https://github.com/JuliaDiff/ChainRules.jl/pull/521 . Can you explain more what the Distributions example is meant to show? At some level `rand!` by itself is obviously wrong: ```julia julia> gradient([1,2,3.0])...
My hope is that eventually general indexing could be supported, and these checks can be removed as soon as there are tests that it works. I didn't bother to figure...