Skip to content
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

fix: Out-Of-Bounds bug in Unsqueeze #1820

Merged
merged 1 commit into from
Apr 12, 2023

Conversation

gs-olive
Copy link
Collaborator

Description

  • Implement support for negative-indexing in unsqueeze, in accordance with the torch.unsqueeze function
  • Fix bug for TFT model in PyTorch, which requires negative indexing in unsqueeze
  • Update core utility logic and comments

Desired Behavior:

torch.unsqueeze(torch.ones(4, 4), -1).shape
>>> (4, 4, 1)

torch.unsqueeze(torch.ones(4, 4), -3).shape
>>> (1, 4, 4)

Fixes #1779

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • [ x ] My code follows the style guidelines of this project (You can use the linters)
  • [ x ] I have performed a self-review of my own code
  • [ x ] I have commented my code, particularly in hard-to-understand areas and hacks
  • [ x ] I have made corresponding changes to the documentation
  • [ x ] I have added tests to verify my fix or my feature
  • [ x ] New and existing unit tests pass locally with my changes
  • [ x ] I have added the relevant labels to my PR in so that relevant reviewers are notified

- Implement support for negative-indexing in unsqueeze, in accordance
with the `torch.unsqueeze` function
- Fix bug for TFT model in PyTorch, which requires negative indexing in
unsqueeze
- Update core utility logic and comments
@gs-olive gs-olive self-assigned this Apr 11, 2023
@github-actions github-actions bot added the component: core Issues re: The core compiler label Apr 11, 2023
@github-actions github-actions bot requested a review from bowang007 April 11, 2023 17:25
Copy link
Collaborator

@narendasan narendasan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@narendasan narendasan merged commit c1bff34 into pytorch:main Apr 12, 2023
bowang007 pushed a commit that referenced this pull request Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed component: core Issues re: The core compiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 [Bug] Error encountered when compiling TFT model
3 participants