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
{{ message }}
Repository navigation
In-place assignment on strictly typed vectors does not report error #76
If using an in-place assignment operator .= from a tracked vector into a typed vector, no error is reported and an incorrect answer is given. Consider the following:
using ReverseDiff
function test1(x)
out = Vector{Float64}(length(x))
out .= 3.0.*x
out .^= 2
return sqrt(dot(out,out))
end
function test2(x)
out = Vector{Any}(length(x))
out .= 3.0.*x
out .^= 2
return sqrt(dot(out,out))
end
input = rand(3)
test1(input) == test2(input)
g1 = ReverseDiff.gradient(test1, input)
g2 = ReverseDiff.gradient(test2, input)
Activity
jrevels commentedon Jun 19, 2017
This is due to
ReverseDiff.jl/src/tracked.jl
Line 246 in d41a29f
antoine-levitt commentedon Aug 16, 2017
Just got hit by this, could this yield an error while the behavior is being worked out?
fix #76
fix #76
fix #76 (#170)