Thank you for your reply. This won’t work in my case, because I need to be able to copy some of the rows multiple times. E.g. if I used [ 0, 0, 0 , 1, 1, 1 ] for “foo” above, then I get three copies of row 0 and three copies of row 1.
Variable containing:
 1.1000  2.2000  3.3000
 1.1000  2.2000  3.3000
 1.1000  2.2000  3.3000
 4.4000  5.5000  6.6000
 4.4000  5.5000  6.6000
 4.4000  5.5000  6.6000
[torch.FloatTensor of size (6,3)]