We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 62cd8e4 commit c8cf47aCopy full SHA for c8cf47a
1 file changed
test/test_traj_zygote.jl
@@ -31,7 +31,7 @@ end
31
grad = Zygote.gradient(traj -> f(traj; Ψtgt, N), traj)[1]
32
@test grad isa NamedTuple
33
@test grad.initial_state isa Vector
34
- expected_grad = -Ψtgt .* conj(dot(Ψ, Ψtgt)) / N
+ expected_grad = -2 .* Ψtgt .* conj(dot(Ψ, Ψtgt)) / N
35
@test norm(grad.initial_state - expected_grad) < 1e-14
36
37
end
@@ -64,7 +64,7 @@ end
64
if grad isa NamedTuple
65
@test grad.initial_state isa Nothing
66
@test grad.kwargs[:x] isa Vector
67
68
@test norm(grad.kwargs[:x] - expected_grad) < 1e-14
69
70
0 commit comments