Skip to content

Commit

Permalink
Updated docstrings referring to torch.expand to point to `torch.Ten…
Browse files Browse the repository at this point in the history
…sor.expand` (pytorch#140045)

`torch.expand` was moved to `torch.Tensor.expand` but some docstrings still refer to `torch.expand`

Pull Request resolved: pytorch#140045
Approved by: https://github.com/mikaylagawarecki
  • Loading branch information
twaclaw authored and pytorchmergebot committed Nov 21, 2024
1 parent d3c8f1a commit 4fb4aa3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion torch/_torch_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -13832,7 +13832,7 @@ def merge_dicts(*dicts):
add_docstr(
torch.expand_copy,
r"""
Performs the same operation as :func:`torch.expand`, but all output tensors
Performs the same operation as :func:`torch.Tensor.expand`, but all output tensors
are freshly created instead of aliasing the input.
""",
)
Expand Down
4 changes: 2 additions & 2 deletions torch/autograd/gradcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -1998,7 +1998,7 @@ def gradcheck(
.. warning::
If any checked tensor in :attr:`input` has overlapping memory, i.e.,
different indices pointing to the same memory address (e.g., from
:func:`torch.expand`), this check will likely fail because the numerical
:func:`torch.Tensor.expand`), this check will likely fail because the numerical
gradients computed by point perturbation at such indices will change
values at all other indices that share the same memory address.
Expand Down Expand Up @@ -2152,7 +2152,7 @@ def gradgradcheck(
.. warning::
If any checked tensor in :attr:`input` and :attr:`grad_outputs` has
overlapping memory, i.e., different indices pointing to the same memory
address (e.g., from :func:`torch.expand`), this check will likely fail
address (e.g., from :func:`torch.Tensor.expand`), this check will likely fail
because the numerical gradients computed by point perturbation at such
indices will change values at all other indices that share the same
memory address.
Expand Down

0 comments on commit 4fb4aa3

Please sign in to comment.