Rate this Page
โ˜… โ˜… โ˜… โ˜… โ˜…

torch.Tensor.index_put_#

Tensor.index_put_(indices, values, accumulate=False) โ†’ Tensor#

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

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

Parameters
  • indices (tuple of LongTensor) โ€“ tensors used to index into self.

  • values (Tensor) โ€“ tensor of same dtype as self.

  • accumulate (bool) โ€“ whether to accumulate into self