-
Notifications
You must be signed in to change notification settings - Fork 27.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MPS: isin_mps_friendly
can support 0D tensors
#34538
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a patch for this? 🤗
I don't think so, it's quite niche 🤔 If we make a patch, yes, let's include it :D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 🤗
test_elements = torch.tensor(test_elements) | ||
if test_elements.ndim == 0: | ||
test_elements = test_elements.unsqueeze(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we ought to open the issue on pytorch / link the tracker !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On torch >=2.4 this is fixed, i.e. torch.isin
is supported with mps
(in other words, this fix only affects older versions of torch) 🤗
Thanks @gante for using my approach. |
* apply fix * tested * make fixup
* apply fix * tested * make fixup
* apply fix * tested * make fixup
* apply fix * tested * make fixup
* apply fix * tested * make fixup
What does this PR do?
Fixes #33786
Applies the fix in
isin_mps_friendly
as suggested by @Swastik-Swarup-Dash here