-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Errors when used with Zygote #58
Comments
If you only need to differentiate setindex of vectors and matrices, a straightforward approach may be to use Re: julia> using StaticArrays, Zygote
julia> gradient(x -> sum(Base.setindex(x, 2, 2)), SA[0,0,0])
Internal error: encountered unexpected error in runtime:
BoundsError(a=Array{Any, (7,)}[
Core.Compiler.VarState(typ=Zygote.Pullback{Tuple{typeof(StaticArrays._setindex), StaticArrays.Length{3}, StaticArrays.SArray{Tuple{3}, Int64, 1, 3}, Int64, Int64}, Any}, undef=false),
Core.Compiler.VarState(typ=FillArrays.Fill{Int64, 1, Tuple{Base.OneTo{Int64}}}, undef=false),
Core.Compiler.VarState(typ=Core.Compiler.Const(val=nothing, actual=false), undef=true),
Core.Compiler.VarState(typ=Any, undef=false),
Core.Compiler.VarState(typ=Any, undef=false),
Core.Compiler.VarState(typ=Any, undef=false),
Core.Compiler.VarState(typ=Any, undef=false)], i=(8,))
rec_backtrace at /buildworker/worker/package_linux64/build/src/stackwalk.c:94 |
Thanks for having a look! I guess that was my question roughly, whether it could automatically hide the mutation when being called by Zygote. Re
|
Are these meant to work?
The text was updated successfully, but these errors were encountered: