Skip to content

Commit

Permalink
Allow for Enzyme choice with callbacks automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Jun 7, 2024
1 parent 2a110dc commit 33a57d2
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/sensitivity_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -364,14 +364,11 @@ function adjoint_sensitivities(sol, args...;
else
has_cb = false
end
if !has_cb
_sensealg = if isinplace(sol.prob)
setvjp(sensealg, inplace_vjp(sol.prob, sol.prob.u0, sol.prob.p, verbose))
else
setvjp(sensealg, ZygoteVJP())
end

_sensealg = if isinplace(sol.prob)
setvjp(sensealg, inplace_vjp(sol.prob, sol.prob.u0, sol.prob.p, verbose))
else
_sensealg = setvjp(sensealg, ReverseDiffVJP())
setvjp(sensealg, ZygoteVJP())
end

return try
Expand Down

0 comments on commit 33a57d2

Please sign in to comment.