Hi!
I want to build a conversational model based on seq2seq.
For using pack_padded_sequence we need to sort sentences by length.
In my case, I have 2 txt files(encoder, decoder) where each line corresponds one sentence, so, for example, the first question in encoder file correspond the first answer in the decoder.

q: [5] | a: [1,2,3,4]
q: [6,7,8] | a: [1,2]

Then when I sort sequences by length I get:

q: [6,7,8] | a: [1,2,3,4]
q: [5] | a: [1,2]

So, h(hidden state) and c(cell state) from encoder will be incorrect for corresponding sentences in the decoder in the batch. How can I solve it? Or I shouldn’t use pack_padded_sequence?
Thanks!