Hello,
It seems to be a minor issue. I’m training a toy siamese network. My label is either -1 or 1, so I was using a LongTensor to store the label. It seems to me that torch complains because target is supposed to be a FloatTensor?
File “/usr/local/lib/python2.7/dist-packages/torch/nn/_functions/loss.py”, line 110, in forward
buffer[torch.eq(target, -1.)] = 0
TypeError: torch.eq received an invalid combination of arguments - got (torch.cuda.LongTensor, float), but expected one of:

(torch.cuda.LongTensor tensor, int value)
didn’t match because some of the arguments have invalid types: (torch.cuda.LongTensor, float)
(torch.cuda.LongTensor tensor, torch.cuda.LongTensor other)
didn’t match because some of the arguments have invalid types: (torch.cuda.LongTensor, float)
(torch.cuda.LongTensor tensor, int value)
didn’t match because some of the arguments have invalid types: (torch.cuda.LongTensor, float)
(torch.cuda.LongTensor tensor, torch.cuda.LongTensor other)
didn’t match because some of the arguments have invalid types: (torch.cuda.LongTensor, float)

Thanks!