ChainRules.jl
ChainRules.jl copied to clipboard
No rules for `typed_hvcat`
This causes problems with Zygote:
julia> using Zygote
julia> gradient(x -> sum([x x]), pi/2)
(2.0,)
julia> gradient(x -> sum(Float32[x x]), pi/2)
ERROR: Mutating arrays is not supported -- called setindex!(Matrix{Float32}, ...)
...
[7] typed_hcat
@ Zygote ./abstractarray.jl:1610 [inlined]
Ideally we'd teach ChainRules how to handled this statement without going through to the implementation.
See also #695