[i][index[i][j][k]][k] # if dim == 1out[i][j][k] = input[i][j][index[i][j][k]] # if dim == 2If input...,[3,4]])>>> torch.gather(t, 1, torch.tensor([[0,0],[1,0]]))tensor([[ 1, 1], [ 4, 3]])torch.index_select...to index out (Tensor, optional) – the output tensor....-1.1068], [-1.1734, -0.6571, 0.7230, -0.6004]])>>> indices = torch.tensor([0, 2])>>> torch.index_select...tensor([[ 0.1427, 0.0231, -0.5414, -1.0009], [-1.1734, -0.6571, 0.7230, -0.6004]])>>> torch.index_select