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
using Zygote
functionmul_good(x)
A = [x 1]
b = [2, 3]
return (A * b)[1]
endfunctionmul_bad(x)
A = [x;; 1]
b = [2, 3]
return (A * b)[1]
end
Zygote.gradient(mul_good, 1) # (2.0,)
Zygote.gradient(mul_bad, 1) # ERROR: Mutating arrays is not supported -- called setindex!(Matrix{Int64}, ...)
white-alistair
changed the title
Zygote can't differentiate through matrix literal with double semicolon
Zygote can't differentiate matrix literal with double semicolon
Apr 14, 2023
MWE
Full stacktrace
Version Info
Zygote v0.6.60
The text was updated successfully, but these errors were encountered: