I’m not really familiar with text processing, so I’m not sure what the best approach would be using TFIDF features,
However, nn.Embedding expects a torch.LongTensor containing indices, so it won’t work with the TFIDF tensor. You could try to pass the word indices to it directly.
The Word Embeddings Tutorial 20 might be a good starter.