1
2
3
4
5
pack = nn_utils.rnn.pack_padded_sequence(embeds_all, limit_x, batch_first=True)

lstm_out, self.hidden = self.lstm(pack, self.hidden)

unpacked = nn_utils.rnn.pad_packed_sequence(lstm_out, batch_first=True)