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
function test(x)
y = [1.0, NaN, 1.0]
sum(filter(!isnan, x.-y))
end
julia> Tracker.gradient(test, [1, 2, 3])
([1.0, 0.0, 1.0] (tracked),)
This does not
function test2(x)
y = [1.0, NaN, 2.0]
sum(filter(!isnan, (x.-y).^2))
end
julia> Tracker.gradient(test2, [1,2,3])
([0.0, NaN, 2.0] (tracked),)
I wouldn't expect the computation (x[2]-y[2])^2 to be in the graph for the result, so I don't understand why this would return NaN. Have I missed something?
The text was updated successfully, but these errors were encountered:
This works as expected
This does not
I wouldn't expect the computation (x[2]-y[2])^2 to be in the graph for the result, so I don't understand why this would return NaN. Have I missed something?
The text was updated successfully, but these errors were encountered: