-
Notifications
You must be signed in to change notification settings - Fork 25.6k
QoL improvements for torch.testing.make_tensor #96125
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
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/96125
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 FailuresAs of commit eaa1141: NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Per title. The major ones: - Enforce keyword only parameters for `_modify_low_high`, which takes 7 parameters. https://github.com/pytorch/pytorch/blob/28aa2efd1422e689d3a7dc6b447ca1f31bbad1c3/torch/testing/_creation.py#L147 is just impossible to comprehend without multiple trips back and forth. - Improve the error messages by including the offending values in the message I'll highlight the smaller ones inline. [ghstack-poisoned]
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.
Per title. The major ones: - Enforce keyword only parameters for `_modify_low_high`, which takes 7 parameters. https://github.com/pytorch/pytorch/blob/28aa2efd1422e689d3a7dc6b447ca1f31bbad1c3/torch/testing/_creation.py#L147 is just impossible to comprehend without multiple trips back and forth. - Improve the error messages by including the offending values in the message I'll highlight the smaller ones inline. [ghstack-poisoned]
import torch | ||
|
||
# Used by make_tensor for generating complex tensor. | ||
complex_to_corresponding_float_type_map = { |
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.
We don't need that since torch.finfo
works for complex types as well.
_INTEGRAL_TYPES = [torch.uint8, torch.int8, torch.int16, torch.int32, torch.int64] | ||
_FLOATING_TYPES = [torch.float16, torch.bfloat16, torch.float32, torch.float64] | ||
_COMPLEX_TYPES = [torch.complex32, torch.complex64, torch.complex128] | ||
_BOOLEAN_OR_INTEGRAL_TYPES = [torch.bool, *_INTEGRAL_TYPES] | ||
_FLOATING_OR_COMPLEX_TYPES = [*_FLOATING_TYPES, *_COMPLEX_TYPES] |
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.
Defining them here do avoid doing it over and over again inside make_tensor
.
Per title. The major ones: - Enforce keyword only parameters for `_modify_low_high`, which takes 7 parameters. https://github.com/pytorch/pytorch/blob/28aa2efd1422e689d3a7dc6b447ca1f31bbad1c3/torch/testing/_creation.py#L147 is just impossible to comprehend without multiple trips back and forth. - Improve the error messages by including the offending values in the message I'll highlight the smaller ones inline. [ghstack-poisoned]
Per title. The major ones: - Enforce keyword only parameters for `_modify_low_high`, which takes 7 parameters. https://github.com/pytorch/pytorch/blob/28aa2efd1422e689d3a7dc6b447ca1f31bbad1c3/torch/testing/_creation.py#L147 is just impossible to comprehend without multiple trips back and forth. - Improve the error messages by including the offending values in the message I'll highlight the smaller ones inline. [ghstack-poisoned]
Per title. The major ones: - Enforce keyword only parameters for `_modify_low_high`, which takes 7 parameters. https://github.com/pytorch/pytorch/blob/28aa2efd1422e689d3a7dc6b447ca1f31bbad1c3/torch/testing/_creation.py#L147 is just impossible to comprehend without multiple trips back and forth. - Improve the error messages by including the offending values in the message I'll highlight the smaller ones inline. [ghstack-poisoned]
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.
Per title. The major ones: - Enforce keyword only parameters for `_modify_low_high`, which takes 7 parameters. https://github.com/pytorch/pytorch/blob/28aa2efd1422e689d3a7dc6b447ca1f31bbad1c3/torch/testing/_creation.py#L147 is just impossible to comprehend without multiple trips back and forth. - Improve the error messages by including the offending values in the message I'll highlight the smaller ones inline. [ghstack-poisoned]
Per title. The major ones: - Enforce keyword only parameters for `_modify_low_high`, which takes 7 parameters. https://github.com/pytorch/pytorch/blob/28aa2efd1422e689d3a7dc6b447ca1f31bbad1c3/torch/testing/_creation.py#L147 is just impossible to comprehend without multiple trips back and forth. - Improve the error messages by including the offending values in the message I'll highlight the smaller ones inline. [ghstack-poisoned]
Rebased |
Per title. The major ones: - Enforce keyword only parameters for `_modify_low_high`, which takes 7 parameters. https://github.com/pytorch/pytorch/blob/28aa2efd1422e689d3a7dc6b447ca1f31bbad1c3/torch/testing/_creation.py#L147 is just impossible to comprehend without multiple trips back and forth. - Improve the error messages by including the offending values in the message I'll highlight the smaller ones inline. [ghstack-poisoned]
Per title. The major ones: - Enforce keyword only parameters for `_modify_low_high`, which takes 7 parameters. https://github.com/pytorch/pytorch/blob/28aa2efd1422e689d3a7dc6b447ca1f31bbad1c3/torch/testing/_creation.py#L147 is just impossible to comprehend without multiple trips back and forth. - Improve the error messages by including the offending values in the message I'll highlight the smaller ones inline. [ghstack-poisoned]
Rebased |
Stack from ghstack (oldest at bottom):
Per title. The major ones:
_modify_low_high
, which takes 7 parameters.pytorch/torch/testing/_creation.py
Line 147 in 28aa2ef
is just impossible to comprehend without multiple trips back and forth.
I'll highlight the smaller ones inline.