Closed sdobber closed 2 years ago
This package should really move to use ChainRulesCore.jl, but when I started I remembered that it's slightly bigger than I thought.
However, this also sounds like one more place that ChainRules types are leaking into Zygote. I didn't isolate this one, but with https://github.com/FluxML/Zygote.jl/pull/1104 it seems to at least run without error:
julia> bw(x -> encoder(x)[1], inp) # works in Zygote 0.6.21, errors in 0.6.22
(nothing, Float32[0.36154643 0.26122904 … 0.10572737 0.10822818; 0.5348399 0.58685553 … 0.29224667 0.16772124; … ; -0.8771012 -0.93331707 … -0.38873446 -0.21984804; -0.12109001 -0.33585894 … -0.09494242 -0.102880865])
Solved with a newer version of Zygote (or one of the dependencies).
The following code defines a part of a neural net that can be differentiated with Zygote 0.6.21. Upgrading to 0.6.22, the error
ERROR: MethodError: no method matching JuliennedArrays.Slices(::ChainRulesCore.NoTangent, ::Int64)
is thrown.