Skip to content

Commit

Permalink
Remove special-casing for FDMBackend2
Browse files Browse the repository at this point in the history
  • Loading branch information
sethaxen committed Jan 9, 2022
1 parent 11a6c94 commit 8b513d0
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions test/test_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,6 @@ function test_jvp(backend; multiple_inputs=true, vaugmented=false)
valvec1, pf1 = AD.value_and_pushforward_function(backend, x -> fjac(x, yvec), xvec)(v[1])
valvec2, pf2 = AD.value_and_pushforward_function(backend, y -> fjac(xvec, y), yvec)(v[2])

# NOTE: added for compatibility with FDMBackend2. Why is this needed?
pf1 = pf1 isa Tuple ? pf1 : (pf1,)
pf2 = pf2 isa Tuple ? pf2 : (pf2,)

@test valvec1 == fjac(xvec, yvec)
@test valvec2 == fjac(xvec, yvec)
@test minimum(isapprox.((pf1[1],pf2[1]), (jxvp(xvec,yvec,v[1]), jyvp(xvec,yvec,v[2])), atol=1e-10))
Expand Down

0 comments on commit 8b513d0

Please sign in to comment.