I did this but got the following error :
add received an invalid combination of arguments - got (torch.FloatTensor), but expected one of:

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

Both my loss are of the same type - nn.CrossEntropyLoss() <class ‘torch.autograd.variable.Variable’>
Any suggestion on how to resolve this please?