Solved by albanD in post #2 
              
              
                Hi, 
It might depend a bit on the memory limitations you have. But the following should work (the sizes are very small for printing purposes): 
import torch

b = 2
c = 3

index = torch.rand(b, c).mul(5).long()
desired_candidate = torch.rand(b, 5).mul(5).long()

print(index)
print(desired_candidate)
…