On this page
torch.Tensor.index_put_
Tensor.index_put_(indices, values, accumulate=False) → Tensor
-
Puts values from the tensor
values
into the tensorself
using the indices specified inindices
(which is a tuple of Tensors). The expressiontensor.index_put_(indices, values)
is equivalent totensor[indices] = values
. Returnsself
.If
accumulate
isTrue
, the elements invalues
are added toself
. If accumulate isFalse
, the behavior is undefined if indices contain duplicate elements.
© 2024, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://pytorch.org/docs/2.1/generated/torch.Tensor.index_put_.html