From 857b8db23f76b539a92db7ed0d6deb5d42f089ca Mon Sep 17 00:00:00 2001 From: willfengg Date: Fri, 26 Apr 2024 23:50:47 -0700 Subject: [PATCH] skip tests that needs cuda Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: --- test/dtypes/test_nf4.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/dtypes/test_nf4.py b/test/dtypes/test_nf4.py index 8194f507ef..16ac53da1f 100644 --- a/test/dtypes/test_nf4.py +++ b/test/dtypes/test_nf4.py @@ -381,6 +381,7 @@ def test_pin_memory(self): nf4_tensor = to_nf4(torch.randn(512 * 512, device='cuda')) self.assertFalse(nf4_tensor.is_pinned()) + @unittest.skipIf(not torch.cuda.is_available(), "Need CUDA available") def test_to_cuda(self): nf4_tensor = to_nf4(torch.randn(512 * 512)) self.assertEqual(nf4_tensor.device.type, "cpu")