The first argument to nn.Embedding should be the num_embeddings, i.e. the size of your dictionary.
In your code sample it looks like you are using a dictionary of 10 words, so try to create your embedding as:
embedding = nn.Embedding(10, 3)

and run your code again.
The error message seems to be a bit strange, as x should be a LongTensor.
Which PyTorch version are you using?