Solved by AbdulsalamBande in post #2 
              
              
                Here is something better. 
import torch
import torch.nn as nn
data_dictionary = {"a":1,"apple":2,"milk":3}
n_tokens = 3
embedding_size = 8
embedding = nn.Embedding(n_tokens, embedding_size)
pretrained_fasttext_embeddings  = torch.rand((n_tokens,embedding_size))
embedding.weight.data.copy_(pretrained…