Skip to content

Commit 7cae837

Browse files
committed
only with CUDA
1 parent a40d6b9 commit 7cae837

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/test_tv_tensors.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,10 @@ def test_force_subclass_with_metadata(return_type):
162162
if return_type == "TVTensor":
163163
assert bbox.format, bbox.canvas_size == (format, canvas_size)
164164

165-
bbox = bbox.pin_memory()
166-
if return_type == "TVTensor":
167-
assert bbox.format, bbox.canvas_size == (format, canvas_size)
165+
if torch.cuda.is_available():
166+
bbox = bbox.pin_memory()
167+
if return_type == "TVTensor":
168+
assert bbox.format, bbox.canvas_size == (format, canvas_size)
168169

169170
assert not bbox.requires_grad
170171
bbox.requires_grad_(True)

0 commit comments

Comments
 (0)