fn
index_select_op
→TensorImplPtrint index_select_op(const int & a, int dim, const int & indices)Python wrappers
Public Python APIs implemented by this engine symbol.Pick indices.size slices along dim of a.
Composite over reshape_op + expand_op + gather_op.
The 1-D index list is reshaped to rank a.ndim (size along dim,
1 elsewhere) and expanded to the source shape so gather_op's
same-rank contract holds.
Math
For each output coordinate along dim:
See Also
take_op — flat indexing; narrow_op — contiguous window.
Parameters
aTensorImplPtrSource tensor of rank .
dimintAxis to index along. Negative values wrap modulo
a.ndim.indicesTensorImplPtr1-D integer tensor (
int32 or int64) of length .Returns
TensorImplPtrTensor with the same shape as a except size along dim.
Raises
IndexErrorIf
dim is out of range.FailureIf
indices is not 1-D or not an integer dtype.