Tensor.sub works, Variable.sub fails with “inconsistent tensor size”
<SCODE>import torch
from torch.autograd import Variable
x = torch.rand(1, 2, 3, 4)
# This succeeds.
x.sub(x.max()) 
v = Variable(x, volatile=True)
# This fails with "RuntimeError: inconsistent tensor size at /data/users/soumith/builder/wheel/pytorch-src/torch/lib/TH/generic/THTensorMath.c:827"
v.sub(v.max())<ECODE>
ndronen
the output of v.max() is Variable with size 1, while x.max() is a scalar
xwgeng
That begs the question whether that is the correct behavior.  Is it?
ndronen
smth
ndronen