Solved by Eta_C in post #2 
              
              
                Just use it directly. Example: 
import torch

boxes = torch.rand(5, 4)
indices = torch.randint(0, 5, (10,))

print(boxes)
print(indices)
print(boxes[indices, :])