i’m not an expert in nlp .
but based on name of function pack_padded_sequence , i think you should first pad the sequence to have the same length.
see this link.
the input sequence of pack_padded_sequence is padded before that.
again i know nothing about nlp.