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, -0.2, 0.6, 0.2, 0.7, 0.3, 0.02, 0.5], learnable params, right?