image.png622×680 20.7 KB

I am trying to implement conv+max_pooling for encoding sentence (as the above figure indicates), yet the documentation for conv2d is kind of messy. Does anyone have experience about this?
Basically, the input is a tensor  a with dimension (sent_len, EMB_SIZE):

a = self.lookup(x_sent).unsqueeze(1)     // I am using batch_size = 1

The output should be a tensor with dimension (1, EMB_SIZE) ?