Skip to content

Commit

Permalink
that wasnt actually a bug in Enzyme, its just really confusing
Browse files Browse the repository at this point in the history
  • Loading branch information
ExpandingMan committed Sep 19, 2024
1 parent d524893 commit 81dc141
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ function DI.jacobian(
backend::AutoEnzyme{<:ReverseMode,Nothing},
x,
) where {M,B}
J = jacobian(mode_noprimal(backend), f, x; n_outs=Val(M), chunk=Val(B))[1]
J = jacobian(mode_noprimal(backend), f, x; n_outs=Val((M,)), chunk=Val(B))[1]
flatjac(x, J)
end

Expand All @@ -230,8 +230,7 @@ function DI.value_and_jacobian(
backend::AutoEnzyme{<:ReverseMode,Nothing},
x,
) where {M,B}
#TODO: right now this is giving different outputs if you pass args Enzyme #1863
jac = jacobian(mode_withprimal(backend), f, x)#; n_outs=Val(M), chunk=Val(B))
jac = jacobian(mode_withprimal(backend), f, x; n_outs=Val((M,)), chunk=Val(B))
return jac.val, flatjac(x, jac.derivs[1])
end

Expand Down

0 comments on commit 81dc141

Please sign in to comment.