Skip to content

Commit b95eb68

Browse files
fix array indexing backward rule (#43)
Co-authored-by: Simeon Schaub <simeondavidschaub99@gmail.com>
1 parent de287ab commit b95eb68

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/stage1/generated.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ function (::∂⃖{N})(::typeof(Base.getindex), a::Array, inds...) where {N}
313313
getindex(a, inds...), let
314314
EvenOddOdd{1, c_order(N)}(
315315
(@Base.aggressive_constprop Δ->begin
316+
Δ isa AbstractZero && return (NoTangent(), Δ, map(Returns(Δ), inds)...)
316317
BB = zero(a)
317318
BB[inds...] = Δ
318319
(NoTangent(), BB, map(x->NoTangent(), inds)...)

0 commit comments

Comments
 (0)