I’ve created a small example here:
batch_size = 64
embedding_dim = 200
vocabulary_size = 100
sentence_len = 80
out_channel = 100

embedding = nn.Embedding(vocabulary_size, embedding_dim)
conv1 = nn.Conv1d(embedding_dim, out_channel, kernel_size=2)

x = torch.empty(batch_size, sentence_len, dtype=torch.long).random_(vocabulary_size)
output = embedding(x)
output = output.permute(0, 2, 1)
output = conv1(output)

I used the Word Embeddings Tutorial 50 as a reference implementation.
The embedding layer will return an output of shape [batch_size, sentence_len, embedding_dim]. After the permute call the shape will be [batch_size, embedding_dim, sentence_len], so that the following conv layer will use all embedding_dim channels for the convolution and a kernel_size=2 so that two neighboring “words” will be used.
Let me know, if that would work for you or if I misunderstood something.