Skip to content

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

Open

Description

@iamkissg

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.

Activity

  1. hunkim commented on Dec 28, 2017

    @hunkim
    Owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions