From de62cab5e3cf067df512f961793789e219e6ba1c Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sun, 21 Jul 2024 17:13:34 -0400 Subject: [PATCH] Revert "Only duplicate and make_zero! if enzyme func is non-constant" This reverts commit 7bc9e2cf1121702356684bc92cb54689a5d3b827. --- src/derivative_wrappers.jl | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/derivative_wrappers.jl b/src/derivative_wrappers.jl index 8f9d82dff..ebd1c1d9e 100644 --- a/src/derivative_wrappers.jl +++ b/src/derivative_wrappers.jl @@ -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,