Oh I see how you added the tensors in your solution:

embedding = self.embedding(x).sum(dim=0)

That’s definitely better than how I did it:

vectors_sum = autograd.Variable(torch.Tensor(1,dimensionality).zero_())
for word in inputs:
     vectors_sum += self.embed(word).view(1, -1)