diff --git a/test/tree/integration/test_torch.py b/test/tree/integration/test_torch.py index 2ce35a0b78..d56da148ed 100644 --- a/test/tree/integration/test_torch.py +++ b/test/tree/integration/test_torch.py @@ -162,7 +162,7 @@ def forward(self, x): 'd': torch.Size([2, 5, 3]), }) - @skipUnless(vpip('torch') and OS.linux and vpython < '3.11', 'torch required') + @skipUnless(torch is not None and vpip('torch') and OS.linux and vpython < '3.11', 'torch required') def test_moduledict(self): with torch.no_grad(): md = torch.nn.ModuleDict({