Thanks for your reply. The first solution is obviously impracticable. torch.LongTensor(node.word_id) would give out a Tensor whose length is node.word_id(an integer). As for the second one, I don’t know the function of .squeeze(). But as the problem occurs in self.embedding(Variable(torch.LongTensor([node.word_id]).cuda()))), it may not help solving the problem either.
Anyway, thanks for your help.