Skip to content

Commit 6c7b9cf

Browse files
authored
Resolve #235 (#237)
* Fix mul * Bump patch
1 parent 105290f commit 6c7b9cf

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ReverseDiff"
22
uuid = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
3-
version = "1.15.0"
3+
version = "1.15.1"
44

55
[deps]
66
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"

src/derivatives/linalg/arithmetic.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ for (f, F) in ((:transpose, :Transpose), (:adjoint, :Adjoint))
301301
# f(a) * b
302302
function reverse_mul!(output, output_deriv, a::$F, b, a_tmp, b_tmp)
303303
_a = ($f)(a)
304-
istracked(_a) && increment_deriv!(_a, ($f)(mul!(a_tmp, output_deriv, value(b))))
304+
istracked(_a) && increment_deriv!(_a, ($f)(mul!(a_tmp, output_deriv, ($f)(value(b)))))
305305
istracked(b) && increment_deriv!(b, mul!(b_tmp, ($f)(mulargvalue(a)), ($f)(output_deriv)))
306306
end
307307
# f(a) * f(b)

test/derivatives/LinAlgTests.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,4 +277,8 @@ test_println("*(A, B) functions", "*(transpose(a), adjoint(b))")
277277
test_arr2arr(*, transpose(a), adjoint(b), tp)
278278
test_arr2arr_inplace(mul!, *, x, transpose(a), adjoint(b), tp)
279279

280+
# Prevent regression on https://github.com/JuliaDiff/ReverseDiff.jl/issues/235
281+
A = [1 2; 3 4]; x = [5, 6];
282+
@test ReverseDiff.gradient(y -> sum(y'*A), x) == [3, 7]
283+
280284
end # module

0 commit comments

Comments
 (0)