Skip to content

Commit 34a66c5

Browse files
authored
Fixed wrong device type for test_psnr on hvd (#2700)
1 parent 29d4573 commit 34a66c5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/ignite/metrics/test_psnr.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,8 @@ def test_distrib_xla_nprocs(xmp_executor):
320320
@pytest.mark.skipif(not idist.has_hvd_support, reason="Skip if no Horovod dist support")
321321
@pytest.mark.skipif("WORLD_SIZE" in os.environ, reason="Skip if launched as multiproc")
322322
def test_distrib_hvd(gloo_hvd_executor):
323-
device = "cpu" if not torch.cuda.is_available() else "cuda"
323+
324+
device = torch.device("cpu" if not torch.cuda.is_available() else "cuda")
324325
nproc = 4 if not torch.cuda.is_available() else torch.cuda.device_count()
325326

326327
gloo_hvd_executor(_test_distrib_input_float, (device,), np=nproc, do_init=True)

0 commit comments

Comments
 (0)