after i added ‘x=’
before view() is torch.Size([16, 128, 1, 1])
after the view() is torch.Size([16, 128])
(what a stupid error i have made…)
but, it still give me such error:
 File "/root/document/A01/textCNN.py", line 45, in forward
    output=self.out(x)
  File "/etc/miniconda3/envs/DL/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "/etc/miniconda3/envs/DL/lib/python3.6/site-packages/torch/nn/modules/linear.py", line 55, in forward
    return F.linear(input, self.weight, self.bias)
  File "/etc/miniconda3/envs/DL/lib/python3.6/site-packages/torch/nn/functional.py", line 1024, in linear
    return torch.addmm(bias, input, weight.t())
RuntimeError: size mismatch, m1: [16 x 128], m2: [16 x 128] at /pytorch/aten/src/TH/generic/THTensorMath.cpp:2070