i have encountered the following error:
gradient = torch.ge(inputs.grad.data,0)
File “/Users/liangshiyu/anaconda2/lib/python2.7/site-packages/torch/tensor.py”, line 331, in sub
return self.sub(other)
TypeError: sub received an invalid combination of arguments - got (torch.cuda.FloatTensor), but expected one of:
- (float value)
didn’t match because some of the arguments have invalid types: (torch.cuda.FloatTensor) - (torch.FloatTensor other)
didn’t match because some of the arguments have invalid types: (torch.cuda.FloatTensor) - (float value, torch.FloatTensor other)