KEMBAR78
Update documentation for torch.mean() to note behavior with empty tensors by PadenMilligan · Pull Request #142039 · pytorch/pytorch · GitHub
Skip to content

Conversation

@PadenMilligan
Copy link
Contributor

This PR updates the documentation for torch.mean() to explicitly mention that computing the mean over an empty tensor returns nan. This clarification helps users understand the behavior and handle it appropriately in their code.

Fixes #141057

@pytorch-bot
Copy link

pytorch-bot bot commented Dec 4, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit d87c417 with merge base 75d57b0 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Dec 4, 2024

CLA Signed

  • ✅login: PadenMilligan / (d87c417)

The committers listed above are authorized under a signed CLA.

@pytorch-bot pytorch-bot bot added the release notes: python_frontend python frontend release notes category label Dec 4, 2024
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

@albanD albanD added the topic: docs topic category label Dec 5, 2024
@albanD
Copy link
Collaborator

albanD commented Dec 5, 2024

@pytorchbot merge

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

pytorch-bot bot pushed a commit that referenced this pull request Dec 9, 2024
…sors (#142039)

This PR updates the documentation for `torch.mean()` to explicitly mention that computing the mean over an empty tensor returns `nan`. This clarification helps users understand the behavior and handle it appropriately in their code.

Fixes #141057

Pull Request resolved: #142039
Approved by: https://github.com/albanD
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 topic: docs topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ambiguous Behavior When Computing Mean of Empty Tensor Returns

4 participants