I also do not understand where the batch_sizes shown for the packed sequence come from.
Also, I would like to know how to best “unsort” the result of running the packed sequence through an LSTM and then unpacking: the unsorting would need to be done in a way to preserve the gradients and I am not sure how to do that best.