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.