index_select(input, index, dim=0)
Returns a new tensor which indexes the input tensor along dimension dim using the entries in index which is a Tensor. The returned tensor has the same number of dimensions as the original input tensor. The dim-th dimension has the same size as the length of index; other dimensions have the same size as in the input tensor.
input (Variable) – The input tensor variable.
index (Variable) – The 1-D tensor containing the indices to index.
dim (int) – The dimension in which we index.
A Tensor with same data type as input.
- Return type