-
Notifications
You must be signed in to change notification settings - Fork 24.7k
Add torch.cat tensors type promotion description #141339
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/141339
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ No FailuresAs of commit 59428ff with merge base dbe4b69 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@albanD please review the change when available, thanks! |
torch/_torch_docs.py
Outdated
.. note:: It is recommended to keep all `tensors` in the same dtype to avoid unintended type promotion. | ||
For example, mixing `torch.int32` and `torch.int64` may result in the output being automatically | ||
promoted to `torch.int64`. |
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.
I'm not sure this is needed. All functions in PyTorch have this behavior of doing type promotion.
If you think it is necessary to leave a comment here, you can make it one sentence and make it not a "may" but "will"
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.
If it's a common sense, I think unnecessary to declare this behavior in the method, removed!
Thanks!
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.
Thanks for fixing the wrong phrasing!
@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 |
@pytorchbot rebase |
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
Successfully rebased |
301fa6f
to
59428ff
Compare
@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: 3 mandatory check(s) failed. The first few are: Dig deeper by viewing the failures on hud |
@pytorchbot merge I had to trigger the CI again before the merge could happen! |
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 |
Fixes #126964
Add note description about type promotion of
torch.cat
Test Result
Before

After

cc @albanD @svekars