a-PyTorch-Tutorial-to-Text-Classification icon indicating copy to clipboard operation
a-PyTorch-Tutorial-to-Text-Classification copied to clipboard

about the pack&pad operation

Open guofei1989 opened this issue 5 years ago • 0 comments

Hi, sgrvinod, I've learned a lot from your tutorials.

The usage of pack&pad operation can eliminate redundant padding calculations in the sequence, which is verified by the tutorial. But I'm curious about how to deal with it if a CNN layer is concatenated after it ?

If we just pad_packed_sequence the packed results from RNN/linear layers, then how can we deal with the padding=0? Use another mask operation or any other methods?

Hope for your reply, thanks!

guofei1989 avatar Apr 02 '20 06:04 guofei1989