RuntimeError: addmm(): argument 'mat1' (position 1) must be Variable, not torch.FloatTensor
I am running this extremely simple PyTorch example NN from the documentation as is, with nothing at all changed. 

I get this error:

Traceback (most recent call last):
  File "&lt;stdin&gt;", line 2, in &lt;module&gt;
  File "/opt/conda/envs/fastai/lib/python3.6/site-packages/torch/nn/modules/module.py", line 357, in __call__
    result = self.forward(*input, **kwargs)
  File "/opt/conda/envs/fastai/lib/python3.6/site-packages/torch/nn/modules/container.py", line 67, in forward
    input = module(input)
  File "/opt/conda/envs/fastai/lib/python3.6/site-packages/torch/nn/modules/module.py", line 357, in __call__
    result = self.forward(*input, **kwargs)
  File "/opt/conda/envs/fastai/lib/python3.6/site-packages/torch/nn/modules/linear.py", line 55, in forward
    return F.linear(input, self.weight, self.bias)
  File "/opt/conda/envs/fastai/lib/python3.6/site-packages/torch/nn/functional.py", line 835, in linear
    return torch.addmm(bias, input, weight.t())
RuntimeError: addmm(): argument 'mat1' (position 1) must be Variable, not torch.FloatTensor


Apparently during the matrix multiplication, there is some data type error.
Why would the matrices I'm trying to multiply need to be Variable anyway?

I can do
x = Variable(torch.randn(N, D_in)) 
y = Variable(torch.randn(N, D_out))
but get
AttributeError: 'Variable' object has no attribute 'item'
so that didn't help.

I am running PyTorch version 0.3.1.post2.

I had the same issue, so I will just add the update commands in case you don't want to search them:
Optional:

conda list | grep pytorch 
conda upgrade conda 


The following update didn't update anything, although they should and I think its the right way to update (you may try it first)

conda update pytorch torchvision


What did help was to specify the version explicitly:

conda install pytorch=0.4.0 -c pytorch

