You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My code used to work in ReverseDiff 1.2.0 but the current version (1.4.2) returns the wrong derivatives. I've stripped away everything to a MWE:
import ForwardDiff
import ReverseDiff
struct Test{TF}
a::TFendfunctionfunc(x)
tvec =Test.(x[1:2])
a = [t.a for t in tvec]
returnsum([a; x[3]])
end
x = [1.0, 2.0, 3.0]
J1 = ForwardDiff.gradient(func, x)
J2 = ReverseDiff.gradient(func, x)
The answer should be [1, 1, 1], but ReverseDiff gives [0, 0, 1]. If I revert back to 1.2 then it works as expected. Trying different versions it seems that from 1.3 onward this no longer works.
The text was updated successfully, but these errors were encountered:
My code used to work in ReverseDiff 1.2.0 but the current version (1.4.2) returns the wrong derivatives. I've stripped away everything to a MWE:
The answer should be [1, 1, 1], but ReverseDiff gives [0, 0, 1]. If I revert back to 1.2 then it works as expected. Trying different versions it seems that from 1.3 onward this no longer works.
The text was updated successfully, but these errors were encountered: