Skip to content

Commit

Permalink
Fix asum for the case where Δx is a matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
YingboMa committed Jan 12, 2020
1 parent 63b9f7e commit c1a4451
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/rulesets/LinearAlgebra/blas.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ end
#####

function frule(::typeof(BLAS.asum), x, _, Δx)
return BLAS.asum(x), sum(zip(x, Δx)) do xs
x, Δx = xs
return sign(x) * Δx
end
return BLAS.asum(x), sum(sign.(x) .* Δx)
end

function rrule(::typeof(BLAS.asum), x)
Expand Down

0 comments on commit c1a4451

Please sign in to comment.