Skip to content

Commit c1a4451

Browse files
committed
Fix asum for the case where Δx is a matrix
1 parent 63b9f7e commit c1a4451

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/rulesets/LinearAlgebra/blas.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,7 @@ end
6868
#####
6969

7070
function frule(::typeof(BLAS.asum), x, _, Δx)
71-
return BLAS.asum(x), sum(zip(x, Δx)) do xs
72-
x, Δx = xs
73-
return sign(x) * Δx
74-
end
71+
return BLAS.asum(x), sum(sign.(x) .* Δx)
7572
end
7673

7774
function rrule(::typeof(BLAS.asum), x)

0 commit comments

Comments
 (0)