This error is raised, if the module parameters (weight and bias) do not have the same type as the input data.
I guess your linear layer has float() parameters, while you are passing double() tensors into it.
Try to call x = x.float() before feeding the data into the model.
This error is often raised, if you created the tensors from numpy arrays, as numpy uses double as the default array type, while PyTorch uses float.