Skip to content

Commit

Permalink
fix array indexing backward rule (#43)
Browse files Browse the repository at this point in the history
Co-authored-by: Simeon Schaub <[email protected]>
  • Loading branch information
GiggleLiu and simeonschaub authored Sep 8, 2021
1 parent de287ab commit b95eb68
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/stage1/generated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ function (::∂⃖{N})(::typeof(Base.getindex), a::Array, inds...) where {N}
getindex(a, inds...), let
EvenOddOdd{1, c_order(N)}(
(@Base.aggressive_constprop Δ->begin
Δ isa AbstractZero && return (NoTangent(), Δ, map(Returns(Δ), inds)...)
BB = zero(a)
BB[inds...] = Δ
(NoTangent(), BB, map(x->NoTangent(), inds)...)
Expand Down

0 comments on commit b95eb68

Please sign in to comment.