Skip to content

Commit

Permalink
Mark hessian_reverse tests unbroken
Browse files Browse the repository at this point in the history
  • Loading branch information
ToucheSir authored Oct 6, 2023
1 parent 4cf706d commit e1b5e0c
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions test/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,8 @@ using ForwardDiff
using Zygote: hessian_dual, hessian_reverse

@testset "hessian: $hess" for hess in [hessian_dual, hessian_reverse]

if hess == hessian_dual
@test hess(x -> x[1]*x[2], randn(2)) [0 1; 1 0]
@test hess(((x,y),) -> x*y, randn(2)) [0 1; 1 0] # original docstring version
else
@test_broken hess(x -> x[1]*x[2], randn(2)) [0 1; 1 0] # can't differentiate ∇getindex
@test_broken hess(((x,y),) -> x*y, randn(2)) [0 1; 1 0]
end
@test hess(x -> x[1]*x[2], randn(2)) [0 1; 1 0]
@test hess(((x,y),) -> x*y, randn(2)) [0 1; 1 0] # original docstring version
@test hess(x -> sum(x.^3), [1 2; 3 4]) Diagonal([6, 18, 12, 24])
@test hess(sin, pi/2) -1

Expand Down

0 comments on commit e1b5e0c

Please sign in to comment.