You are recreating the nn.Linear layer in each forward pass with random parameters, so that it won’t be trained.
Create the layer in the __init__ method in the same way other layers were initialized and use it in the forward method.
I would recommend to check the input and output shape of the embedding layer to make sure it’s working as expected.