diff --git a/src/concrete_solve.jl b/src/concrete_solve.jl index 707c7f95d..20b0d0e88 100644 --- a/src/concrete_solve.jl +++ b/src/concrete_solve.jl @@ -1519,6 +1519,9 @@ function DiffEqBase._concrete_solve_adjoint( end function steadystatebackpass(Δ) + if originator isa SciMLBase.TrackerOriginator + Δ = Tracker.data(Δ) + end # Δ = dg/dx or diffcache.dg_val # del g/del p = 0 function df(_out, u, p, t, i) diff --git a/src/steadystate_adjoint.jl b/src/steadystate_adjoint.jl index 5b7b88c4a..4daeb7eba 100644 --- a/src/steadystate_adjoint.jl +++ b/src/steadystate_adjoint.jl @@ -55,7 +55,11 @@ end if needs_jac if DiffEqBase.has_jac(f) - f.jac(diffcache.J, y, p, nothing) + if DiffEqBase.isinplace(sol.prob) + f.jac(diffcache.J, y, p, nothing) + else + copyto!(diffcache.J, f.jac(y, p, nothing)) + end else if DiffEqBase.isinplace(sol.prob) jacobian!(diffcache.J, diffcache.uf, y, diffcache.f_cache,