Skip to content

Commit de95e15

Browse files
Update GraphNeuralNetworks/test/test_module.jl
1 parent b5130f0 commit de95e15

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

GraphNeuralNetworks/test/test_module.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,7 @@ function test_gradients(
125125
if test_mooncake
126126
# Mooncake gradient with respect to input via Flux integration, compared against Zygote.
127127
loss_mc_x = (xs...) -> loss(f, graph, xs...)
128-
result = Flux.withgradient(loss_mc_x, Flux.AutoMooncake(), xs...)
129-
y_mc = result.val # Extract value from NamedTuple
130-
g_mc = result.grad # Extract gradients tuple
128+
y_mc, g_mc = Flux.withgradient(loss_mc_x, Flux.AutoMooncake(), xs...)
131129
@assert isapprox(y, y_mc; rtol, atol)
132130
check_equal_leaves(g, g_mc; rtol, atol)
133131
end

0 commit comments

Comments
 (0)