We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5fe0965 commit 3caef5eCopy full SHA for 3caef5e
2 files changed
DifferentiationInterface/src/check.jl
@@ -28,9 +28,9 @@ Check whether `backend` supports second order differentiation by trying to compu
28
"""
29
function check_hessian(backend::AbstractADType)
30
try
31
- x = [3.0]
+ x = [1.0, 3.0]
32
hess = hessian(sqnorm, backend, x)
33
- return isapprox(hess, [2.0;;]; rtol=1e-3)
+ return isapprox(hess, [2.0 0.0; 0.0 2.0]; rtol=1e-3)
34
catch exception
35
@warn "Backend $backend does not support hessian" exception
36
return false
DifferentiationInterface/test/second_order.jl
@@ -28,7 +28,7 @@ mixed_second_order_backends = [
for backend in vcat(
dense_second_order_backends, sparse_second_order_backends, mixed_second_order_backends
)
- check_hessian(backend)
+ @test check_hessian(backend)
end
test_differentiation(
0 commit comments