-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Export torch.newaxis=None for Python Array API/Numpy consistency #125026
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
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/125026
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 203992f with merge base 3d8585e ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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.
Seems ok per this comment but adding @lezcano just in case
@pytorchbot merge |
Merge startedYour 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 |
Merge failedReason: 1 mandatory check(s) failed. The first few are: Dig deeper by viewing the failures on hud |
Sorry, I did not run the |
In the end I force-pushed the original commit to keep the merge history clean. The |
# NumPy consistency (https://numpy.org/devdocs/reference/constants.html) | ||
from math import e , nan , inf , pi | ||
__all__.extend(['e', 'pi', 'nan', 'inf']) | ||
newaxis: None = None |
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.
The type of none is NoneType
.
Also, no need to keep the history clean, as we squeeze all the commits on merge
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.
nvm
Note that None as a type hint is a special case and is replaced by type(None).
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.
Also, no need to keep the history clean, as we squeeze all the commits on merge
Thanks, I did not know 🙏
@pytorchbot merge |
Merge startedYour 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 |
…orch#125026) Fixes pytorch#65307 For consistency with Python Array API (https://data-apis.org/array-api/latest/API_specification/constants.html) and NumPy (https://numpy.org/devdocs/reference/constants.html), I added `torch.newaxis = None`. Note that the consistency is directly mentioned also in the `__init__.py`, right above the added export. The `torch.newaxis` is also mentioned in pytorch#110636. Pull Request resolved: pytorch#125026 Approved by: https://github.com/lezcano
Fixes #65307
For consistency with Python Array API (https://data-apis.org/array-api/latest/API_specification/constants.html) and NumPy (https://numpy.org/devdocs/reference/constants.html), I added
torch.newaxis = None
.Note that the consistency is directly mentioned also in the
__init__.py
, right above the added export.The
torch.newaxis
is also mentioned in #110636.cc @mruberry @rgommers