KEMBAR78
Add torch.squeeze parameter description to declare allowed type by zeshengzong · Pull Request #137485 · pytorch/pytorch · GitHub
Skip to content

Conversation

@zeshengzong
Copy link
Contributor

@zeshengzong zeshengzong commented Oct 8, 2024

Fixes #137422

Add parameter type definition in API docs to clarify allowed value type, eliminate users pass None as dim value directly.

>>> import torch
>>> x = torch.randn(3,1,2)
>>> x.squeeze(dim=None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: Please look up dimensions by name, got: name = None.

cc @albanD

@pytorch-bot
Copy link

pytorch-bot bot commented Oct 8, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/137485

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit bfebfd9 with merge base 9f9d252 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot bot added the release notes: python_frontend python frontend release notes category label Oct 8, 2024
@zeshengzong zeshengzong marked this pull request as ready for review October 8, 2024 08:47
Copy link
Collaborator

@albanD albanD left a comment

Choose a reason for hiding this comment

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

Thanks!

@zeshengzong
Copy link
Contributor Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 9, 2024
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

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

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged open source release notes: python_frontend python frontend release notes category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

torch.squeeze does not accept dim=None

4 participants