Skip to content

Change torch.mps.is_available() to torch.backends.mps.is_available()#3

Open
kartikeyporwal wants to merge 1 commit intolihaoyun6:mainfrom
kartikeyporwal:change_mps_availablity_check
Open

Change torch.mps.is_available() to torch.backends.mps.is_available()#3
kartikeyporwal wants to merge 1 commit intolihaoyun6:mainfrom
kartikeyporwal:change_mps_availablity_check

Conversation

@kartikeyporwal
Copy link
Copy Markdown

torch.mps.is_available() was added in pytorch/pytorch#132426. It was most likely shipped with torch==2.5.0 in Oct 17, 2024.

Using torch.backends.mps.is_available() ensures that the code works with torch<2.5.0 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant