Skip to content

Commit 793b92c

Browse files
Update test/cuda/layers.jl
1 parent ca283f7 commit 793b92c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/cuda/layers.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,5 +133,7 @@ end
133133
gs_gpu = gradient(() -> sum(abs2.(b(x, y))), params(b))
134134
b_cpu, x_cpu, y_cpu = b |> cpu, x |> cpu, y |> cpu
135135
gs_cpu = gradient(() -> sum(abs2.(b_cpu(x_cpu, y_cpu))), params(b_cpu))
136-
@test gs_cpu Array(gs_gpu)
136+
for (pgpu, pcpu) in zip(params(b), params(b_cpu))
137+
@test gs_cpu[pcpu] Array(gs_gpu[pgpu])
138+
end
137139
end

0 commit comments

Comments
 (0)