Skip to content

Commit

Permalink
Merge pull request #101 from JoHof/mps_backend_safeguard
Browse files Browse the repository at this point in the history
check if mps submodule is available
  • Loading branch information
JoHof committed Jan 6, 2024
2 parents 129e343 + 175cd7f commit b0d4ab8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lungmask/mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def __init__(
if not self.force_cpu:
if torch.cuda.is_available():
self.device = torch.device("cuda")
elif torch.backends.mps.is_available():
elif "mps" in torch.backends.__dict__ and torch.backends.mps.is_available():
if torch.backends.mps.is_built():
self.device = torch.device("mps")
logger.info(
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="lungmask",
version="0.2.18",
version="0.2.19",
author="Johannes Hofmanninger",
author_email="[email protected]",
description="Package for automated lung segmentation in CT",
Expand Down

0 comments on commit b0d4ab8

Please sign in to comment.