Hi,
I don’t know if this is the right way:
Suppose lengths is the length of all sentences.
ordered_len,ordered_idx=lengths.sort(0, descending=True)
Then after we get the result from RNN, we can unsort it by:
new_result[ordered_idx]=result