TypeError: descriptor 'sub' requires a 'torch._C.FloatTensorBase' object but received a 'Variable'

I’m trying to deduct one tensor from another with sub, tensors covered in Variable.

torch.Tensor.sub(X,Y) returns

TypeError: descriptor ‘sub’ requires a ‘torch._C.FloatTensorBase’ object but received a ‘Variable’

torch.sub(X,Y) returns

returns AttributeError: module ‘torch’ has no attribute ‘sub’

Hi,

I think you just want to do X - Y or X.sub(Y).