From 4f9a9f1a0037b166c681b47373045f459fa0cedb Mon Sep 17 00:00:00 2001 From: HansBug Date: Fri, 20 Oct 2023 15:28:22 +0800 Subject: [PATCH] dev(hansbug): fix bug in unittest --- test/tree/integration/test_torch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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({