First of all, thanks for your great tutorial on pytorch! It's a great help for beginners.
In the line 54, the output of 'nn.LSTM' has been changed in pytorch 1.0, the shape of output is (seq_len, batch, num_directions * hidden_size) respectively now. And in line 57, it should be out[-1:, , :] not out[:, -1, :]
@yunjey : )
Sorry, I don't notice the parameter batch_first in 'nn.LSTM' which If true the input and output tensors are provided as (batch, seq, feature).
I close the issue now.
https://github.com/yunjey/pytorch-tutorial/blob/4896cefea1eb86cc96ff363c84767ca94cb559c6/tutorials/02-intermediate/recurrent_neural_network/main.py#L54-L57
First of all, thanks for your great tutorial on pytorch! It's a great help for beginners. In the line 54, the output of 'nn.LSTM' has been changed in pytorch 1.0, the shape of output is (seq_len, batch, num_directions * hidden_size) respectively now. And in line 57, it should be out[-1:, , :] not out[:, -1, :]
@yunjey : )