I want to use the last hidden state for bilstm, for each batch, I firstly sort each example that is in the same batch. and then use pack_padded_sequence->lstm →  pad_packed_sequence. then Back to the original position。 but I want to use the last hidden state. is that right in my code

Screen Shot 2021-06-21 at 10.47.43 AM961×290 29.2 KB

?