@@ -20,8 +20,8 @@ function h(dy, x)
2020end
2121
2222cache1 = ForwardDiff. Dual{typeof (ForwardDiff. Tag (SparseDiffTools. DeivVecTag (), eltype (x))),
23- eltype (x), 1 }. (x, ForwardDiff. Partials .(Tuple .(v)))
24- cache2 = ForwardDiff. Dual {typeof(ForwardDiff.Tag(SparseDiffTools.DeivVecTag(), eltype(x))), eltype(x), 1} .(x, ForwardDiff. Partials .(Tuple .(v)))
23+ eltype (x), 1 }. (x, ForwardDiff. Partials .(tuple .(v)))
24+ cache2 = ForwardDiff. Dual {typeof(ForwardDiff.Tag(SparseDiffTools.DeivVecTag(), eltype(x))), eltype(x), 1} .(x, ForwardDiff. Partials .(tuple .(v)))
2525@test num_jacvec! (dy, f, x, v)≈ ForwardDiff. jacobian (f, similar (x), x) * v rtol= 1e-6
2626@test num_jacvec! (dy, f, x, v, similar (v),
2727 similar (v))≈ ForwardDiff. jacobian (f, similar (x), x) * v rtol= 1e-6
@@ -50,9 +50,9 @@ cache2 = ForwardDiff.Dual{typeof(ForwardDiff.Tag(SparseDiffTools.DeivVecTag(), e
5050@test numback_hesvec (g, x, v)≈ ForwardDiff. hessian (g, x) * v rtol= 1e-8
5151
5252cache3 = ForwardDiff. Dual{typeof (ForwardDiff. Tag (Nothing, eltype (x))), eltype (x), 1
53- }. (x, ForwardDiff. Partials .(Tuple .(v)))
53+ }. (x, ForwardDiff. Partials .(tuple .(v)))
5454cache4 = ForwardDiff. Dual{typeof (ForwardDiff. Tag (Nothing, eltype (x))), eltype (x), 1
55- }. (x, ForwardDiff. Partials .(Tuple .(v)))
55+ }. (x, ForwardDiff. Partials .(tuple .(v)))
5656@test autoback_hesvec! (dy, g, x, v)≈ ForwardDiff. hessian (g, x) * v rtol= 1e-8
5757@test autoback_hesvec! (dy, g, x, v, cache3, cache4)≈ ForwardDiff. hessian (g, x) * v rtol= 1e-8
5858@test autoback_hesvec (g, x, v)≈ ForwardDiff. hessian (g, x) * v rtol= 1e-8
@@ -135,8 +135,8 @@ gmres!(out, L, v)
135135x = rand (N)
136136v = rand (N)
137137L = HesVecGrad (h, x, autodiff = AutoFiniteDiff ())
138- @test L * x ≈ num_hesvec (g, x, x)
139- @test L * v ≈ num_hesvec (g, x, v)
138+ @test L * x ≈ num_hesvec (g, x, x) rtol = 1e-2
139+ @test L * v ≈ num_hesvec (g, x, v) rtol = 1e-2
140140@test mul! (dy, L, v)≈ num_hesvec (g, x, v) rtol= 1e-2
141141dy= rand (N);_dy= copy (dy);@test mul! (dy,L,v,a,b)≈ a* num_hesvec (g,x,v)+ b* _dy rtol= 1e-2
142142update_coefficients! (L, v, nothing , 0.0 )
0 commit comments