Adding a scalar?
Dumb question, but how do I make a scalar Variable? I’d like to add a trainable parameter to a vector, but I keep getting size-mismatch problems. <SCODE># Works, but I can't make the 2 a 
# parameter, so I can't do gradient descent on it
Variable(torch.from_numpy(np.ones(5))) + 2 
<ECODE> Thanks!
ririw
<SCODE>x = Variable(torch.from_numpy(np.ones(5)))
y = Variable(torch.Tensor([2]).double()) # numpy is double by default
z = x + y.expand(x.size())
<ECODE>
fmassa
Great, thanks for that.
ririw