Hello,
From my understanding, in the implementation of your first network. You take the last time step y = out[:, -1, 0] to decode is incorrect. Because the output of pad_packed_sequence is containing a lot of zero padded to make sure all sequences in this batch has the same shape. Therefore, you have to rely on the lens_unpacked to select the correct last time step to decode