skip XPU for dataloader CPU only unit test (#159811)

Fixes [#159802](https://github.com/pytorch/pytorch/issues/159802)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/159811
Approved by: https://github.com/izaitsevfb
This commit is contained in:
Divyansh Khanna
2025-08-05 03:44:01 +00:00
committed by PyTorch MergeBot
parent bbc0df1094
commit 4fd5fabee9

View File

@ -3133,6 +3133,8 @@ class TestDictDataLoader(TestCase):
self.assertTrue(sample["a_tensor"].is_pinned())
self.assertTrue(sample["another_dict"]["a_number"].is_pinned())
@skipIfXpu
@skipIfRocm
@unittest.skipIf(TEST_CUDA, "Test for when CUDA is not available")
def test_pin_memory_no_cuda(self):
loader = DataLoader(self.dataset, batch_size=2, pin_memory=True)