Skip to content

Commit bbd2680

Browse files
Merge pull request #86 from dhairyagandhi96/dg/adjoint
Adjoint for VecOfArray getindex
2 parents 5ae0c43 + 7e514a2 commit bbd2680

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)