nn.Embedding() takes indices of words as input and gives it’s embedding as output.
The question is not clear. here are two things to clarify:


By your question, I understand that you want to concatenate each word’s embedding with its one-hot vector. Is that right? In that case, the output of the nn.Embedding() layer should be concatenated with one hot vector.







 stephan_shar:

’Mr’ + [0,0,0,0], ‘Clinton’ + [0,0,0,0]…


In your example, you have appended ‘Mr’, ‘Clinton’ both with [0,0,0,0]. Is it intentional to have same index for these words?