-
Notifications
You must be signed in to change notification settings - Fork 90
Open
Description
Apparently reverse-mode jacobian tries to mutate something, and StaticArrays aren't happy:
julia> import Enzyme
julia> using StaticArrays
julia> x = @SVector(ones(2))
2-element SVector{2, Float64} with indices SOneTo(2):
1.0
1.0
julia> Enzyme.jacobian(Enzyme.Reverse, identity, x)
ERROR: setindex!(::SVector{2, Float64}, value, ::Int) is not defined.
Hint: Use `MArray` or `SizedArray` to create a mutable static array
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] setindex!(a::SVector{2, Float64}, value::Float64, i::Int64)
@ StaticArrays ~/.julia/packages/StaticArrays/lZeGV/src/indexing.jl:3
[3] zerosetfn!(x::SVector{2, Float64}, i::Int64, val::Float64)
@ Enzyme ~/.julia/packages/Enzyme/R6sE8/src/sugar.jl:11
[4] #130
@ ~/.julia/packages/Enzyme/R6sE8/src/sugar.jl:935 [inlined]
[5] ntuple
@ ./ntuple.jl:49 [inlined]
[6] jacobian(mode::EnzymeCore.ReverseMode{…}, f::typeof(identity), x::SVector{…}; n_outs::Val{…}, chunk::Nothing)
@ Enzyme ~/.julia/packages/Enzyme/R6sE8/src/sugar.jl:929
[7] jacobian
@ ~/.julia/packages/Enzyme/R6sE8/src/sugar.jl:846 [inlined]
[8] #jacobian#129
@ ~/.julia/packages/Enzyme/R6sE8/src/sugar.jl:861 [inlined]
[9] jacobian(mode::EnzymeCore.ReverseMode{…}, f::typeof(identity), x::SVector{…})
@ Enzyme ~/.julia/packages/Enzyme/R6sE8/src/sugar.jl:846
[10] top-level scope
@ ~/Documents/GitHub/Julia/DifferentiationInterface.jl/DifferentiationInterface/test/Back/Enzyme/playground.jl:8
Some type information was truncated. Use `show(err)` to see complete types.Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels