Skip to content

Commit e41e87f

Browse files
committed
fix _test_device_management
1 parent edb99b9 commit e41e87f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/test_prediction_pipeline_device_management.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def _test_device_management(model_package: Path, weight_format: WeightsFormat):
1818
from bioimageio.core._prediction_pipeline import create_prediction_pipeline
1919
from bioimageio.core.digest_spec import get_test_inputs, get_test_outputs
2020

21-
if torch.cuda.device_count() == 0:
21+
if not hasattr(torch, "cuda") or torch.cuda.device_count() == 0:
2222
raise TooFewDevicesException("Need at least one cuda device for this test")
2323

2424
bio_model = load_description(model_package)

0 commit comments

Comments
 (0)