Skip to content

Commit

Permalink
Revert "Only duplicate and make_zero! if enzyme func is non-constant"
Browse files Browse the repository at this point in the history
This reverts commit 7bc9e2c.
  • Loading branch information
ChrisRackauckas committed Jul 21, 2024
1 parent 7bc9e2c commit de62cab
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/derivative_wrappers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -707,16 +707,11 @@ function _vecjacobian!(dλ, y, λ, p, t, S::TS, isautojacvec::EnzymeVJP, dgrad,

isautojacvec = get_jacvec(sensealg)

if Core.Compiler.isconstType(_tmp6)
Enzyme.make_zero!(_tmp6)
_f = Enzyme.Duplicated(S.diffcache.pf, _tmp6)
else
_f = S.diffcache.pf
end
Enzyme.make_zero!(_tmp6)

if inplace_sensitivity(S)
if W === nothing
Enzyme.autodiff(Enzyme.Reverse, _f,
Enzyme.autodiff(Enzyme.Reverse, Enzyme.Duplicated(S.diffcache.pf, _tmp6),
Enzyme.Const, Enzyme.Duplicated(tmp3, tmp4),
Enzyme.Duplicated(ytmp, tmp1),
dup,
Expand Down

0 comments on commit de62cab

Please sign in to comment.