Runtime Error on my loss function

Expected object of type torch.LongTensor but found type torch.IntTensor for argument #2 ‘target’

Do I simply convert the argument in question to tensor.long( ) ?

This could be a solution. Could you try that and see, if you’ll get any other errors?