Solved by ptrblck in post #2 
              
              
                I think gather is what you are looking for: 
x = torch.randn(10, 5, 3)
index = torch.empty(10, 5, 1, dtype=torch.long).random_(3)
x.gather(2, index)