This can be solved using broadcasting but it involves having to manually make a repeat tensor of type LongInt.
A minimal example is:
import torch
a = torch.arange(35).view((5,7))
rep = torch.tensor([0,1,1,1,3,3,2])
a_ = a[rep,:]

This outputs
tensor([[ 0,  1,  2,  3,  4,  5,  6],
        [ 7,  8,  9, 10, 11, 12, 13],
        [ 7,  8,  9, 10, 11, 12, 13],
        [ 7,  8,  9, 10, 11, 12, 13],
        [21, 22, 23, 24, 25, 26, 27],
        [21, 22, 23, 24, 25, 26, 27],
        [14, 15, 16, 17, 18, 19, 20]])