Implementing LSTM using PyTorch but get an error in linear

The part related is as below:

tensor([[-0.0106, 0.8890, 0.0561, 0.9582, -0.0059, 0.7418, -0.0096, 0.9744]])
this is the x in my first loop above.
Sorry if it is hard to read because I can only post one image.
I am wondering why I am getting this error message and what it means. If I change the shape from[1,8] to [8,1] then I get a message like dimension mismatch [8,1] [8,5]

How can I fix this problem?

Could you post the code and error message directly by wrapping them into three backticks ``` please? :slight_smile:

Thank you for reply. The problem has been resolved. I was trying to withdraw this post.

ptrblck via PyTorch Forums noreply@discuss.pytorch.org于2020年4月26日 周日04:18写道: