Skip to content

Commit

Permalink
add some batch tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Sep 22, 2023
1 parent 9273a20 commit 84c5196
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion test/enzyme.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,18 @@ db12 = FiniteDiff.finite_difference_gradient(x->f(A,x, b2), copy(b1))

@test dA dA2
@test db1 db12
@test db2 == zeros(4)
@test db2 == zeros(4)

A = rand(n, n);
dA = zeros(n, n);
dA2 = zeros(n, n);
b1 = rand(n);
db1 = zeros(n);
db12 = zeros(n);

b2 = rand(n);
db2 = zeros(n);
db22 = zeros(n);

@test_broken Enzyme.autodiff(Reverse, f, Duplicated(copy(A), dA), BatchDuplicated(copy(b1), (db1, db12)), BatchDuplicated(copy(b2), (db2, db22)))
@test_broken Enzyme.autodiff(Reverse, f, BatchDuplicated(copy(A), (dA, dA2)), Duplicated(copy(b1), db1), Duplicated(copy(b2), db2))

0 comments on commit 84c5196

Please sign in to comment.