Skip to content

Commit

Permalink
Fix MyPy error when Torch without MPS support is installed (#708)
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldk authored Jun 29, 2022
1 parent 0640617 commit 2ef3f3a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions thinc/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
has_torch_cuda_gpu = torch.cuda.device_count() != 0
has_torch_mps_gpu = (
hasattr(torch, "has_mps")
and torch.has_mps
and torch.backends.mps.is_available()
and torch.has_mps # type: ignore[attr-defined]
and torch.backends.mps.is_available() # type: ignore[attr-defined]
)
has_torch_gpu = has_torch_cuda_gpu
torch_version = Version(str(torch.__version__))
Expand Down

0 comments on commit 2ef3f3a

Please sign in to comment.