Skip to content

[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

Closed
wants to merge 4 commits into from

Conversation

zasdfgbnm
Copy link
Collaborator

@zasdfgbnm zasdfgbnm commented Jun 1, 2020

A unique_consecutive version of #38156

@zasdfgbnm zasdfgbnm requested a review from apaszke as a code owner June 1, 2020 18:08
@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Jun 1, 2020
@zasdfgbnm zasdfgbnm requested review from eellison and suo June 1, 2020 18:08
Copy link
Contributor

@eellison eellison left a 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))
Copy link
Contributor

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

Copy link
Collaborator Author

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.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

zasdfgbnm added a commit to aiqm/torchani that referenced this pull request Jun 1, 2020
On par with pytorch/pytorch#39339

This breaks the compatibility with PyTorch 1.5.0, but hopefully will be compatible with 1.5.1.
@zasdfgbnm zasdfgbnm deleted the jit-unique-consecutive branch June 2, 2020 21:57
zasdfgbnm added a commit to zasdfgbnm/pytorch that referenced this pull request Jun 2, 2020
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
@facebook-github-bot
Copy link
Contributor

@eellison merged this pull request in ebd4125.

zasdfgbnm added a commit to aiqm/torchani that referenced this pull request Jun 11, 2020
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Merged oncall: jit Add this issue/PR to JIT oncall triage queue open source
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants