ForwardDiff2.jl
ForwardDiff2.jl copied to clipboard
Incorrect gradient + dual leakage
Though this is a similar symptom to #31, it's a very different (and more interesting) case. Although FD2 can't force users not to leak duals in general, in this case it has every opportunity to deal with them as usual but simply doesn't.
julia> D(1) do x
D(2) do y
D(3) do z
x = z * y
end
end
x
end
(2 + 1ϵ₂)
(correct answer is 0; ForwardDiff throws an ambiguous tag error which is the easy fix in this case too, assuming there's no interest in making the tag system more capable.)