Skip to content

Commit 8924dc2

Browse files
factnnclaude
andcommitted
fix: move both res and ref to CPU before comparison
torch.cudnn_convolution is CUDA-only, so both tensors stay on GPU. gems_assert_close requires both on same device; move both to CPU. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 56cb917 commit 8924dc2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/test_cudnn_convolution.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def test_cudnn_convolution_2d(
5252
allow_tf32=False,
5353
)
5454

55-
gems_assert_close(res_out, ref_out.cpu(), dtype)
55+
gems_assert_close(res_out.cpu(), ref_out.cpu(), dtype)
5656

5757

5858
SHAPE_CUDNN_CONV1D = [
@@ -99,7 +99,7 @@ def test_cudnn_convolution_1d(shape, kernel, stride, padding, dtype, monkeypatch
9999
allow_tf32=False,
100100
)
101101

102-
gems_assert_close(res_out, ref_out.cpu(), dtype)
102+
gems_assert_close(res_out.cpu(), ref_out.cpu(), dtype)
103103

104104

105105
SHAPE_CUDNN_CONV3D = [
@@ -148,4 +148,4 @@ def test_cudnn_convolution_3d(
148148
allow_tf32=False,
149149
)
150150

151-
gems_assert_close(res_out, ref_out.cpu(), dtype)
151+
gems_assert_close(res_out.cpu(), ref_out.cpu(), dtype)

0 commit comments

Comments
 (0)