Solved by RoySadaka in post #2 
              
              
                @zqu1992 
I can confirm that, and this also happens with the nn.embedding version: 
predefined_weights = torch.rand(10, 3) 
emb = torch.nn.Embedding(num_embeddings=10, embedding_dim=3, padding_idx=0, _weight=predefined_weights) 
emb(torch.LongTensor([[0,2,0,5]])) 
It “pads” with the vector at idx=0 …