Solved by ptrblck in post #2 
              
              
                Your code just works fine: 
a = torch.tensor([5, 6, 7, 8, 9])
idx = torch.tensor([[1, 2],
                    [4, 4],
                    [3, 3],
                    [0, 1],
                    [2, 0]])

a[idx]
> tensor([[6, 7],
        [9, 9],
        [8, 8],
        [5, 6],
        [7, 5]])