Solved by G.M in post #2 
              
              
                You can try index_select: T.index_select(-1, tc.tensor(i)). Also, you need to be careful about the shape of the output of index_select.