Skip to content

Commit

Permalink
Show computed jacobians in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sharanry committed Nov 5, 2023
1 parent 3f88629 commit ae4aa3e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/enzyme.jl
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,16 @@ manual_jac = map(onehot(A)) do dA
y = A \ b1
sum(inv(A) * (db1 - dA*y))
end |> collect
@show manual_jac

fd_jac = FiniteDiff.finite_difference_jacobian(fA, A) |> vec
@show fd_jac

en_jac = map(onehot(A)) do dA
eres = Enzyme.autodiff(Forward, fA, Duplicated(copy(A), dA))
eres[1]
end |> collect
@show en_jac

@test_broken en_jac manual_jac
@test_broken en_jac fd_jac

0 comments on commit ae4aa3e

Please sign in to comment.