Skip to content

Commit

Permalink
chore: protect against wrong p in adjointdiffcache
Browse files Browse the repository at this point in the history
  • Loading branch information
DhairyaLGandhi committed Jun 27, 2024
1 parent a752804 commit 9f888fe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/adjoint_common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ function adjointdiffcache(g::G, sensealg, discrete, sol, dgdu::DG1, dgdp::DG2, f
tunables, repack = p, identity
elseif isscimlstructure(p)
tunables, repack, _ = canonicalize(Tunable(), p)
else
elseif isfunctor(p)
tunables, repack = Functors.functor(p)
else
throw(SciMLStructuresCompatibilityError())
end
if prob isa Union{SteadyStateProblem, NonlinearProblem}
tspan = (nothing, nothing)
Expand Down

0 comments on commit 9f888fe

Please sign in to comment.