We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5ae0c43 + 7e514a2 commit bbd2680Copy full SHA for bbd2680
src/zygote.jl
@@ -1,7 +1,6 @@
1
ZygoteRules.@adjoint function getindex(VA::AbstractVectorOfArray, i)
2
function AbstractVectorOfArray_getindex_adjoint(Δ)
3
- Δ′ = Union{Nothing, eltype(VA.u)}[nothing for x in VA.u]
4
- Δ′[i] = Δ
+ Δ′ = [ (i == j ? Δ : zero(x)) for (x,j) in zip(VA.u, 1:length(VA))]
5
(Δ′,nothing)
6
end
7
VA[i],AbstractVectorOfArray_getindex_adjoint
0 commit comments