How to use pack_padded_sequence in seq2seq models

Hello @jekbradbury This is regarding the loss, I have tried to follow your advice (How can i compute seq2seq loss using mask?). To work out something on the decoder side where I find the cross entropy loss and with that i multiply the decoder mask. But now I am not able to figure out how can I apply the same rule to the encoder outputs as the encoder outputs would be (seq_len,batch_size,hidden_size) and the encoder mask (seq_len,batch_size).