mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
Skip test if torchvision is not available (#149494)
The test unconditionally imports torchvision and fails if the isn't installed. Skip it in this case. Pull Request resolved: https://github.com/pytorch/pytorch/pull/149494 Approved by: https://github.com/janeyx99
This commit is contained in:
parent
b0a5d55c58
commit
19b763def1
|
|
@ -58,7 +58,10 @@ class BenchmarkFusionTestTemplate:
|
||||||
|
|
||||||
@slowTest
|
@slowTest
|
||||||
def test_resnet18(self):
|
def test_resnet18(self):
|
||||||
import torchvision
|
try:
|
||||||
|
import torchvision
|
||||||
|
except ImportError:
|
||||||
|
self.skipTest("TorchVision not available")
|
||||||
|
|
||||||
model = torchvision.models.resnet18()
|
model = torchvision.models.resnet18()
|
||||||
model.eval()
|
model.eval()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user