A user wants to load a pre-trained word2vec embedding with gensim into a PyTorch embedding layer. How to get the embedding weights loaded by gensim into the PyTorch embedding layer?
There is a function from_pretrained() which makes loading an embedding very comfortable. Below is an example of the code
The weights from gensim can be obtained by