index_put(input: Tensor, indices: list[Tensor] | tuple[Tensor, ...], values: Tensor, accumulate: bool = False)Out-of-place advanced-indexing write.
Equivalent to out = input.clone(); out[indices] = values (or
out[indices] += values when accumulate=True) under reference
framework semantics. indices is a sequence of integer tensors,
one per leading dimension; broadcasting between them follows the
standard rules.
Fewer index tensors than dimensions index the leading dimensions and
take the rest whole, as the reference does: index_put(x, (i,), v)
on a (4, 3) tensor writes whole rows.
Parameters
inputTensorDestination tensor.
indicessequence of TensorsOne integer index tensor per leading dimension of
input; the
dimensions after them are taken whole. All broadcast to a common
shape.valuesTensorValues to scatter, broadcastable to the common index shape
followed by the dimensions taken whole.
accumulatebool= FalseIf True, add at each position; otherwise overwrite.