2

I have a batch of variable length sequences padded with 0 (padding = post) and would like to perform conv1D to generate feature maps. How does PyTorch conv1D handle padded sequences? For example, the rnn (recurrent neural network) and crf (conditional random fields) layers do allow masking the padded sequences, but I did not see such an option in conv1D.

I did check out the conv1D layer and there is an option to pad the sequences, but it does not seem to be similar to the padding and masking I am talking about.

m = nn.Conv1d(100, 6, 2, padding= 1)

I will be really grateful for any help.

PinkBanter
  • 1,686
  • 5
  • 17
  • 38

0 Answers0