Tensor.__setitem__

Tensor.__setitem__(self, indices, values)[source]

Implement self[indices] = values.

This method should be overridden by subclasses.

Parameters
indicesindex expression

Integer, slice or sequence of these, defining the positions of the data array which should be written to.

valuesscalar, array-like or Tensor

The value(s) that are to be assigned.

If index is an integer, value must be a scalar.

If index is a slice or a sequence of slices, value must be broadcastable to the shape of the slice.