Skip to content

Commit

Permalink
Try removing Fill sum rule too
Browse files Browse the repository at this point in the history
  • Loading branch information
ToucheSir authored Sep 5, 2023
1 parent 73ebf4b commit c5042e2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -329,13 +329,15 @@ end
end

# Reductions
#=
@adjoint function sum(xs::AbstractArray; dims = :)
if dims === (:)
sum(xs), Δ -> (Fill(Δ, size(xs)),)
else
sum(xs, dims = dims), Δ -> (similar(xs) .= Δ,)
end
end
=#

@adjoint function sum(xs::AbstractArray{Bool}; dims = :)
sum(xs, dims = dims), Δ -> (nothing,)
Expand Down

0 comments on commit c5042e2

Please sign in to comment.