Solved by spanev in post #4 
              
              
                Well, I believe that’s exactly what my example does. 
Let’s check: 
t = torch.tensor([2., 4., 6.], requires_grad=True)
emb = nn.Embedding(10, 10)
>>> emb(t.long()).shape
torch.Size([3, 10]) 

Each number maps to a row in emb. 
Or am I still missing something? 
What are the numbers in [0.01, 0.2, 0.5…