samim:

  File "/home/samim/Documents/model.py", line 29, in encoder
    z = F.elu(self.enc1(x))
  File "/home/samim/miniconda3/envs/deep/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/samim/miniconda3/envs/deep/lib/python3.6/site-packages/torch/nn/modules/linear.py", line 93, in forward
    return F.linear(input, self.weight, self.bias)
  File "/home/samim/miniconda3/envs/deep/lib/python3.6/site-packages/torch/nn/functional.py", line 1688, in linear
    if input.dim() == 2 and bias is not None:
AttributeError: 'int' object has no attribute 'dim'






 samim:

    for i in range(len(x)):
        optimizer.zero_grad()
        pred = model.forward(i)



Your code pass integer to model, not Tensor and does not use DataLoader nor DataSet. I think this caused the error.