Hi @ptrblck thank you so much for your reply.



 ptrblck:

In your example the conv layer would convolve the embedding tensor using its kernel size in sentence_len and embedding_dim dimension.


This isn’t what I want to do is. I would like to convolve the  embedding  2x embedding_dim. I’ve read your reply but since I am pretty new with pytorch, I couldn’t understand it completely. If you don’t mind could you explain it a little bit more ? (Maybe with a simple example?)
Let me give more details about my problem. I would like to apply n-gram filters for my sentence where n is 2. So, I want to convolve the embeddings of each consecutive 2 words in the sentence. When I check the output of my convolution operation it seems it gives the correct shape (64, 100, 79, 1) where 79 = Sentence-len-2+1 but results I obtain tell me I have a bug somewhere in the code.