I guess your view operations might change the batch size, which could yield this error, so you should check:
embeds_1 = sum(embeds).view(1,-1)

and
return self.embeddings(target).view(1,-1)

which both flatten the tensor so that it would have a batch size of 1.
Usually you would keep the batch size equal and flatten the other dimensions via:
tensor = tensor.view(tensor.size(0), -1)