Skip to content

Commit

Permalink
chore: update callbacks forward mode path to SciMLSensitivity
Browse files Browse the repository at this point in the history
  • Loading branch information
DhairyaLGandhi committed Jul 29, 2024
1 parent e1bbd25 commit 3f2ea4e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/concrete_solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -661,12 +661,15 @@ function DiffEqBase._concrete_solve_adjoint(prob::SciMLBase.AbstractODEProblem,
args...;
save_idxs = nothing,
kwargs...)
if !(p isa Union{Nothing, SciMLBase.NullParameters, AbstractArray}) ||
(p isa AbstractArray && !Base.isconcretetype(eltype(p)))
throw(ForwardSensitivityParameterCompatibilityError())
if p === nothing || p isa SciMLBase.NullParameters
tunables, repack = p, identity
elseif isscimlstructure(p)
tunables, repack, _ = canonicalize(Tunable(), p)
else
throw(SciMLStructuresCompatibilityError())
end

if p isa AbstractArray && eltype(p) <: ForwardDiff.Dual &&
if tunables isa AbstractArray && eltype(tunables) <: ForwardDiff.Dual &&
!(eltype(u0) <: ForwardDiff.Dual)
# Handle double differentiation case
u0 = eltype(p).(u0)
Expand Down

0 comments on commit 3f2ea4e

Please sign in to comment.