Input preparation
Hello all, For instance, the fallowing code results in error: <SCODE>(class model above)
    self.affine1(10, 100)
(...)

x = np.random.random(10)
ipt = torch.from_numpy(x)
probs = model(Variable(ipt))
<ECODE> Then <SCODE>TypeError: addmm_ received an invalid combination of arguments - got (int, int, torch.DoubleTensor, torch.FloatTensor), but expected one of:
 * (torch.DoubleTensor mat1, torch.DoubleTensor mat2)
(...)
<ECODE> How is the proper data preparation in pytorch? Thanks in advance and looking forward to use pytorch (the performance of the cart pole in openai gym was better than with other frameworks). Obs: As I didn’t saw any other mechanic-ish question topic, nor a question flag, hope that is not off topic for the forum.
gabrieldlm
hi there. In this particular case, thanks for your feedback. We will improve our onboarding process, by making more newbie friendly tutorials. <SCODE>ipt = torch.from_numpy(x)
ipt = ipt.float()
<ECODE>
smth
Please, let me know of anything you think it should be included, so that I can better plan the structure of my lessons.
Atcold
Thanks for the reply, but after changing the tensor type to float I get the fallowing error: <SCODE>RuntimeError: matrices expected, got 1D, 2D tensors at /Users/soumith/anaconda/conda-bld/pytorch0.1.6_1484755992574/work/torch/lib/TH/generic/THTensorMath.c:857
<ECODE> <SCODE>print ipt
(...)
[torch.FloatTensor of size 10]<ECODE>
gabrieldlm
smth
Atcold
gabrieldlm
Atcold
henrye