Skip to content

Commit 8e44dc7

Browse files
committed
renable diaghessian test
1 parent 1cc024e commit 8e44dc7

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

test/utils.jl

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,10 @@ end
2525
xs, y = randn(2,3), rand()
2626
f34(xs, y) = xs[1] * (sum(xs .^ (1:3)') + y^4) # non-diagonal Hessian, two arguments
2727

28-
# Following should work once we workout what ForwardDiff should do when `Float64` is called on a `Dual`
29-
# https://github.com/JuliaDiff/ForwardDiff.jl/pull/538
30-
# else might need a custom overload of `(;;ChainRulesCore.ProjectTo)(::Dual)`
31-
# When fixed uncomment the below and delete the broken function
32-
#==
3328
dx, dy = diaghessian(f34, xs, y)
3429
@test size(dx) == size(xs)
3530
@test vec(dx) diag(hessian(x -> f34(x,y), xs))
3631
@test dy hessian(y -> f34(xs,y), y)
37-
==#
38-
function broken()
39-
dx, dy = diaghessian(f34, xs, y) # This fails becase ProjectTo can't project a Dual onto a Float
40-
c1 = size(dx) == size(xs)
41-
c2 = vec(dx) diag(hessian(x -> f34(x,y), xs))
42-
c3 = dy hessian(y -> f34(xs,y), y)
43-
return all([c1, c2, c3])
44-
end
45-
@test_broken broken()
4632

4733
zs = randn(7,13) # test chunk mode
4834
@test length(zs) > ForwardDiff.DEFAULT_CHUNK_THRESHOLD

0 commit comments

Comments
 (0)