I’m not sure how to use convolutions with textual input, but based on your description, I assume you would like to use the 5 different words as one spatial dimension and the embedding size as the other.
If that’s the case, you could try the following:
x = torch.randn(1, 1, 5, 128) # batch_size, channels, height, width
conv = nn.Conv2d(1, 4, (2, 128))
output = conv(x)