-
Notifications
You must be signed in to change notification settings - Fork 24.9k
[JIT] Make torch.unique_consecutive compatible #39339
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
Conversation
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.
LGTM! Thanks for doing this.
test/test_jit.py
Outdated
@@ -10189,6 +10189,17 @@ def torch_unique(dim: Optional[int]): | |||
self.checkScript(torch_unique, (None,)) | |||
self.checkScript(torch_unique, (0,)) | |||
|
|||
def torch_unique_consecutive(dim: Optional[int]): | |||
ten = torch.unique(torch.tensor([[1, 3], [2, 3]], dtype=torch.long)) |
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.
maybe add some consecutive values that are the same
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.
@eellison That is a good idea! I have added consecutive values for the test.
Could you land this for me? I don't work for FB, so I can not land it by myself.
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.
@eellison has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
On par with pytorch/pytorch#39339 This breaks the compatibility with PyTorch 1.5.0, but hopefully will be compatible with 1.5.1.
Cherry pick of pytorch#39339 Summary: A `unique_consecutive` version of pytorch#38156 Pull Request resolved: pytorch#39339 Differential Revision: D21823997 Pulled By: eellison fbshipit-source-id: d14596a36ba36497e296da5a344e0376cef56f1b
* Remove workaround for TorchScript bug on torch.unique_consecutive On par with pytorch/pytorch#39339 This breaks the compatibility with PyTorch 1.5.0, but hopefully will be compatible with 1.5.1. * trigger ci * trigger * trigger Co-authored-by: Farhad Ramezanghorbani <farhadrgh@users.noreply.github.com>
A
unique_consecutive
version of #38156