From f47306ceb49e285bf0c3ad0ddc14ea5549f2a9ba Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Fri, 6 Dec 2024 17:40:11 +0100 Subject: [PATCH] Typo --- .../forward_onearg.jl | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/DifferentiationInterface/ext/DifferentiationInterfaceEnzymeExt/forward_onearg.jl b/DifferentiationInterface/ext/DifferentiationInterfaceEnzymeExt/forward_onearg.jl index 5335ed472..00b66808a 100644 --- a/DifferentiationInterface/ext/DifferentiationInterfaceEnzymeExt/forward_onearg.jl +++ b/DifferentiationInterface/ext/DifferentiationInterfaceEnzymeExt/forward_onearg.jl @@ -199,10 +199,9 @@ function DI.jacobian( backend::AutoEnzyme{<:Union{ForwardMode,Nothing},<:Union{Nothing,Const}}, x, ) where {F,B} + mode = forward_noprimal(backend) f_and_df = get_f_and_df(f, backend, mode) - derivs = jacobian( - forward_noprimal(backend), f_and_df, x; chunk=Val(B), shadows=prep.shadows - ) + derivs = jacobian(mode, f_and_df, x; chunk=Val(B), shadows=prep.shadows) jac_tensor = only(derivs) return maybe_reshape(jac_tensor, prep.output_length, length(x)) end @@ -213,10 +212,9 @@ function DI.value_and_jacobian( backend::AutoEnzyme{<:Union{ForwardMode,Nothing},<:Union{Nothing,Const}}, x, ) where {F,B} + mode = forward_withprimal(backend) f_and_df = get_f_and_df(f, backend, mode) - (; derivs, val) = jacobian( - forward_withprimal(backend), f_and_df, x; chunk=Val(B), shadows=prep.shadows - ) + (; derivs, val) = jacobian(mode, f_and_df, x; chunk=Val(B), shadows=prep.shadows) jac_tensor = only(derivs) return val, maybe_reshape(jac_tensor, prep.output_length, length(x)) end