Skip to content

Commit 82d61a0

Browse files
Update test/cuda/layers.jl
1 parent 67d016b commit 82d61a0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/cuda/layers.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ end
131131
@test size(b(x,y)) == (3,9)
132132
@test sum(abs2, b(x,y)) 0f0
133133
@test_nowarn gs_gpu = gradient(() -> sum(abs2.(b(x,y))), params(b))
134-
gs_cpu = gradient(() -> sum(abs2.(b(x |> cpu,y |> cpu) |> cpu)), params(b))
134+
b_cpu, x_cpu, y_cpu = b |> cpu, x |> cpu, y |> cpu
135+
gs_cpu = gradient(() -> sum(abs2.(b_cpu(x_cpu, y_cpu)), params(b_cpu))
135136
@test Array(gs_cpu) gs_gpu
136137
end

0 commit comments

Comments
 (0)