The docs say
h_n of shape (num_layers * num_directions, batch, hidden_size): tensor containing the hidden state for t = seq_len
Now, the batch and hidden_size dimensions are pretty much self-explanatory. The first dimension remains a mystery, though.
I assume, that the hidden states of all "last cells" of all layers are included in this output. But then what is the index of, for example, the hidden state of the "last cell" in the "uppermost layer"? h_n[-1]? h_n[0]?
Is the output affected by the batch_first option?