Skip to content

Conversation

@mruberry
Copy link
Collaborator

torch.sub was undocumented, so this PR adds its documentation, analogous to torch.add's documentation, and adds the alias torch.subtract for torch.sub, too. This alias comes from NumPy (see https://numpy.org/doc/stable/reference/generated/numpy.subtract.html?highlight=subtract#numpy.subtract)

@mruberry mruberry requested a review from apaszke as a code owner August 30, 2020 02:35
@mruberry mruberry added module: numpy Related to numpy support, and also numpy compatibility of our operators module: docs Related to our documentation, both in docs/ and docblocks labels Aug 30, 2020
@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Aug 30, 2020
@mruberry mruberry requested review from ngimel and removed request for apaszke August 30, 2020 02:44
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mruberry has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

""" + r"""
When :attr:`other` is a tensor, the shape of :attr:`other` must be
:ref:`broadcastable <broadcasting-semantics>` with the shape of the underlying
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's underlying tensor?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who knows?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per offline conversation: this note will be modernized to "This op supports..." and include a broadcasting and type promotion reference.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mruberry has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@codecov
Copy link

codecov bot commented Aug 30, 2020

Codecov Report

Merging #43850 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #43850   +/-   ##
=======================================
  Coverage   69.32%   69.32%           
=======================================
  Files         378      378           
  Lines       46745    46749    +4     
=======================================
+ Hits        32404    32407    +3     
- Misses      14341    14342    +1     
Impacted Files Coverage Δ
torch/overrides.py 98.01% <ø> (ø)
torch/_tensor_docs.py 100.00% <100.00%> (ø)
torch/_torch_docs.py 100.00% <100.00%> (ø)
torch/testing/_internal/expecttest.py 77.55% <0.00%> (-1.03%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 628db96...d965ff6. Read the comment docs.

@facebook-github-bot
Copy link
Contributor

@mruberry merged this pull request in 3aeb70d.

@ezyang
Copy link
Contributor

ezyang commented Aug 31, 2020

A request: please don't make unrelated whitespace changes in PRs; this just cost me another failed land (will have to try again tomorrow)

@mruberry
Copy link
Collaborator Author

Sorry about that @ezyang. I'll change my editor to not auto-truncate lines.

@ezyang
Copy link
Contributor

ezyang commented Aug 31, 2020

Or better yet, add a lint rule to prevent trailing whitespace and banish it from the codebase entirely :)

@facebook-github-bot facebook-github-bot deleted the sub_docs branch January 27, 2021 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged module: docs Related to our documentation, both in docs/ and docblocks module: numpy Related to numpy support, and also numpy compatibility of our operators oncall: jit Add this issue/PR to JIT oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants