Oh I see, that totally make sense now, Thanks a lot.
I am sorry, I just got confused with the steps,
I should pad the sequences, then use DataLoader()  to create batches and then pack_padded_sequence to feed in inputs?
and can I use pack_padded_sequence for any deep learning networks? like Transformer?