8000 Add torch.cat tensors type promotion description by zeshengzong · Pull Request #141339 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

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

Closed
wants to merge 2 commits into from

Conversation

zeshengzong
Copy link
Contributor
@zeshengzong zeshengzong commented Nov 22, 2024

Fixes #126964

Add note description about type promotion of torch.cat

Test Result

Before
image

After
image

cc @albanD @svekars

Copy link
pytorch-bot bot commented Nov 22, 2024

🔗 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 SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ No Failures

As of commit 59428ff with merge base dbe4b69 (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 Nov 22, 2024
@zeshengzong zeshengzong marked this pull request as ready for review November 22, 2024 13:32
@colesbury colesbury requested a review from svekars November 26, 2024 21:34
@colesbury colesbury added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Nov 26, 2024
@svekars svekars requested a review from albanD November 26, 2024 22:37
@zeshengzong
Copy link
Contributor Author

@albanD please review the change when available, thanks!

Comment on lines 2304 to 2306
.. 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`.
Copy link
Collaborator

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"

Copy link
Contributor Author

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!

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 for fixing the wrong phrasing!

@albanD
Copy link
Collaborator
albanD commented Dec 13, 2024

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Dec 13, 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

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 1 mandatory check(s) failed. The first few are:

Dig deeper by viewing the failures on hud

Details for Dev Infra team Raised by workflow job

Failing merge rule: Core Maintainers

@zeshengzong
Copy link
Contributor Author

@pytorchbot rebase

@pytorchmergebot
Copy link
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

@pytorchmergebot
Copy link
Collaborator

Successfully rebased opt/docs/8 onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via git checkout opt/docs/8 && git pull --rebase)

@zeshengzong
Copy link
Contributor Author

@pytorchbot merge

@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

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 3 mandatory check(s) failed. The first few are:

Dig deeper by viewing the failures on hud

Details for Dev Infra team Raised by workflow job

Failing merge rule: Core Maintainers

@albanD
Copy link
Collaborator
albanD commented Dec 13, 2024

@pytorchbot merge

I had to trigger the CI again before the merge could happen!

@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 triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implicit data type promotion in torch.cat is undocumented
5 participants
0