def _create_embeddings(dictionary, embedding_size, padding_idx):
    'Create and initialize word embeddings.'
    e = nn.Embedding(len(dictionary), embedding_size, padding_idx)
    nn.init.normal_(e.weight, mean=0, std=(embedding_size ** (- 0.5)))
    nn.init.constant_(e.weight[padding_idx], 0)
    return e
Create and initialize word embeddings.
def _create_embeddings(dictionary, embedding_size, padding_idx):
    
    e = nn.Embedding(len(dictionary), embedding_size, padding_idx)
    nn.init.normal_(e.weight, mean=0, std=(embedding_size ** (- 0.5)))
    nn.init.constant_(e.weight[padding_idx], 0)
    return e