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
This was discussed in #547 (comment) but just wanted to make this issue to track it and to provide a MWE (StaticArrays 0.12.3 / Zygote 0.4.20):
julia>using StaticArrays, Zygote
julia> x =@SVector[ [1,2] ]
1-element SArray{Tuple{1},Array{Int64,1},1,1} with indices SOneTo(1):
[1, 2]
julia>gradient(x ->sum(x[1]), x)
ERROR:setindex!() with non-isbitstype eltype is not supported by StaticArrays. Consider using SizedArray.
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] setindex! at /home/marius/.julia/packages/StaticArrays/mlIi1/src/MArray.jl:99 [inlined]
[3] macro expansion at /home/marius/.julia/packages/StaticArrays/mlIi1/src/arraymath.jl:105 [inlined]
[4] _fill! at /home/marius/.julia/packages/StaticArrays/mlIi1/src/arraymath.jl:101 [inlined]
[5] fill!(::MArray{Tuple{1},Union{Nothing, FillArrays.Fill{Int64,1,Tuple{Base.OneTo{Int64}}}},1,1}, ::Nothing) at /home/marius/.julia/packages/StaticArrays/mlIi1/src/arraymath.jl:99
[6] _zero(::SArray{Tuple{1},Array{Int64,1},1,1}, ::Type{T}where T) at /home/marius/.julia/packages/Zygote/YeCEW/src/lib/array.jl:52
[7] (::Zygote.var"#1040#1042"{SArray{Tuple{1},Array{Int64,1},1,1},Tuple{Int64}})(::FillArrays.Fill{Int64,1,Tuple{Base.OneTo{Int64}}}) at /home/marius/.julia/packages/Zygote/YeCEW/src/lib/array.jl:40
[8] (::Zygote.var"#2739#back#1036"{Zygote.var"#1040#1042"{SArray{Tuple{1},Array{Int64,1},1,1},Tuple{Int64}}})(::FillArrays.Fill{Int64,1,Tuple{Base.OneTo{Int64}}}) at /home/marius/.julia/packages/ZygoteRules/6nssF/src/adjoint.jl:49
[9] literal_getindex at /home/marius/.julia/packages/Zygote/YeCEW/src/lib/lib.jl:94 [inlined]
[10] (::typeof(∂(literal_getindex)))(::FillArrays.Fill{Int64,1,Tuple{Base.OneTo{Int64}}}) at /home/marius/.julia/packages/Zygote/YeCEW/src/compiler/interface2.jl:0
[11] #13 at ./none:1 [inlined]
[12] (::typeof(∂(#13)))(::Int64) at /home/marius/.julia/packages/Zygote/YeCEW/src/compiler/interface2.jl:0
[13] (::Zygote.var"#36#37"{typeof(∂(#13))})(::Int64) at /home/marius/.julia/packages/Zygote/YeCEW/src/compiler/interface.jl:46
[14] gradient(::Function, ::SArray{Tuple{1},Array{Int64,1},1,1}) at /home/marius/.julia/packages/Zygote/YeCEW/src/compiler/interface.jl:55
[15] top-level scope at none:0
This was discussed in #547 (comment) but just wanted to make this issue to track it and to provide a MWE (StaticArrays 0.12.3 / Zygote 0.4.20):
I actually think the fix belongs in StaticArrays: JuliaArrays/StaticArrays.jl#799
The text was updated successfully, but these errors were encountered: