Indeed since you reproduced the error the rnn.pack_padded_sequece() has the problem.
The case is that I want to train my own embeddings that’s why I used the embedding layer. Afterwards, train a second algorithm using pre-trained glove embeddings. To train the customer embeddings with nn.Embedding layer is it necessary to use the rnn.pack_padded_sequence() method or is there any alternative?