Tensor.__getitem__

Tensor.__getitem__(indices)[source]

Return self[indices].

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 accessed.

Returns:
valuesTensorSpace.dtype or Tensor

The value(s) at the given indices. Note that depending on the implementation, the returned object may be a (writable) view into the original array.