8000 Fix on XPU · pytorch/pytorch@3cc73a6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3cc73a6

Browse files
committed
Fix on XPU
ghstack-source-id: 9626b07 Pull Request resolved: #152812
1 parent 0ffd31d commit 3cc73a6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/test_xpu.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,13 +334,13 @@ def test_device_context_manager(self):
334334
self.assertEqual(torch.xpu.current_device(), prev_device)
335335

336336
@unittest.skipIf(not TEST_MULTIXPU, "only one GPU detected")
337-
def test_device_context_manager_with_set_device(self):
337+
def test_multi_device_context_manager(self):
338338
src_device = 0
339339
dst_device = 1
340340
torch.xpu.set_device(src_device)
341341
with torch.accelerator.device_index(dst_device):
342342
self.assertEqual(torch.xpu.current_device(), 1)
343-
self.assertEqual(torch.xpu.set_device(), src_device)
343+
self.assertEqual(torch.xpu.current_device(), src_device)
344344

345345
def test_stream_context_manager(self):
346346
prev_stream = torch.xpu.current_stream()

0 commit comments

Comments
 (0)
0