Thanks, the following worked for me. Your example helped me. I didn’t know that the embedding dimension can be used as the number of in-channels.
m = nn.Conv1d(200, 10, 2)
input = Variable(torch.randn(10, 200, 5))
feature_maps1 = m(input)
print(feature_maps1.size())

I have one question. Why the kernel size can be a tuple in Conv1d? Even the stride, padding, dilation everything can be tuple. How they can be tuple for Conv1d? Can you provide an example?
@smth, yes I saw that example previously. At that time, I was assuming that for text data, number of channels should be 1. I never thought the way @spro used Conv1d in his provided example!