Skip to content

Commit 7e514a2

Browse files
author
Dhairya Gandhi
committed
fix adjoint
1 parent 5ae0c43 commit 7e514a2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/zygote.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
ZygoteRules.@adjoint function getindex(VA::AbstractVectorOfArray, i)
22
function AbstractVectorOfArray_getindex_adjoint(Δ)
3-
Δ′ = Union{Nothing, eltype(VA.u)}[nothing for x in VA.u]
4-
Δ′[i] = Δ
3+
Δ′ = [ (i == j ? Δ : zero(x)) for (x,j) in zip(VA.u, 1:length(VA))]
54
(Δ′,nothing)
65
end
76
VA[i],AbstractVectorOfArray_getindex_adjoint

0 commit comments

Comments
 (0)