-
Notifications
You must be signed in to change notification settings - Fork 29
Closed
Description
I would expect DifferentiationInterface.jl to internally make a copy of p with the right type for SCT.
MWE:
using ADTypes: AutoForwardDiff
using DifferentiationInterface: AutoSparse, Cache, prepare_jacobian
using SparseConnectivityTracer: TracerSparsityDetector
using SparseMatrixColorings: GreedyColoringAlgorithm
using ForwardDiff
function f!(du, u, p)
p[1] = u[1]
du[1] = -3.0 * p[1]
end
backend = AutoSparse(
AutoForwardDiff();
sparsity_detector=TracerSparsityDetector(),
coloring_algorithm=GreedyColoringAlgorithm(),
)
du = zeros(1)
u = ones(1)
p = [3.0]
prep = prepare_jacobian(f!, du, backend, u, Cache(p))Stacktrace:
ERROR: TypeError: in typeassert, expected Float64, got a value of type SparseConnectivityTracer.GradientTracer{SparseConnectivityTracer.IndexSetGradientPattern{Int64, BitSet}}
Stacktrace:
[1] setindex!(A::Vector{…}, x::SparseConnectivityTracer.GradientTracer{…}, i::Int64)
@ Base .\array.jl:987
[2] f!(du::Vector{…}, u::Vector{…}, p::Vector{…})
...
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels