Skip to content
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

Fix index_put doc. #48673

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions torch/_tensor_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1809,26 +1809,26 @@ def add_docstr_all(method, docstr):

add_docstr_all('index_put_',
r"""
index_put_(indices, value, accumulate=False) -> Tensor
index_put_(indices, values, accumulate=False) -> Tensor

Puts values from the tensor :attr:`value` into the tensor :attr:`self` using
Puts values from the tensor :attr:`values` into the tensor :attr:`self` using
the indices specified in :attr:`indices` (which is a tuple of Tensors). The
expression ``tensor.index_put_(indices, value)`` is equivalent to
``tensor[indices] = value``. Returns :attr:`self`.
expression ``tensor.index_put_(indices, values)`` is equivalent to
``tensor[indices] = values``. Returns :attr:`self`.

If :attr:`accumulate` is ``True``, the elements in :attr:`value` are added to
If :attr:`accumulate` is ``True``, the elements in :attr:`values` are added to
:attr:`self`. If accumulate is ``False``, the behavior is undefined if indices
contain duplicate elements.

Args:
indices (tuple of LongTensor): tensors used to index into `self`.
value (Tensor): tensor of same dtype as `self`.
values (Tensor): tensor of same dtype as `self`.
accumulate (bool): whether to accumulate into self
""")

add_docstr_all('index_put',
r"""
index_put(tensor1, indices, value, accumulate=False) -> Tensor
index_put(tensor1, indices, values, accumulate=False) -> Tensor

Out-place version of :meth:`~Tensor.index_put_`.
`tensor1` corresponds to `self` in :meth:`torch.Tensor.index_put_`.
Expand Down