Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does batch_first really also work on the shape of RNN's hidden vector? #16

Open
iamkissg opened this issue Dec 28, 2017 · 1 comment
Open

Comments

@iamkissg
Copy link

Hi, in your code for 12_1_rnn_basics, you mentioned that

#(batch, num_layers * num_directions, hidden_size) for batch_first=True

However, in pytorch's docs, it just said:

batch_first – If True, then the input and output tensors are provided as (batch, seq, feature)

So I got confused which one was right? Then I printed the shape of RNN's hidden vector after executing this line, which turned out to be [1, 3, 2].

So could you please tell me which one is right, and explain why the output is [1, 3, 2]?

Thank you very much.

@hunkim
Copy link
Owner

hunkim commented Dec 28, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants