Skip to content

Commit

Permalink
Typo
Browse files Browse the repository at this point in the history
  • Loading branch information
gdalle committed Dec 6, 2024
1 parent eef9e42 commit f47306c
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit f47306c

Please sign in to comment.