Skip to content

[docs] added num_directions explanation to docstrings#10786

Closed
rohan-varma wants to merge 1 commit intopytorch:masterfrom
rohan-varma:rv/num-directions
Closed

[docs] added num_directions explanation to docstrings#10786
rohan-varma wants to merge 1 commit intopytorch:masterfrom
rohan-varma:rv/num-directions

Conversation

@rohan-varma
Copy link
Contributor

Resolving #10741. The current docs use num_directions quite a bit, without any explanation for them. num_directions is set to 2 if the RNN is bidirectional, or 1 otherwise. This change simply adds that to the docs.

:func:`torch.nn.utils.rnn.pack_sequence` for details.
- **h_0** of shape `(num_layers * num_directions, batch, hidden_size)`: tensor
containing the initial hidden state for each element in the batch.
If the RNN is bidirectional, num_directions should be 2, else it should be 1.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

Copy link
Contributor

@zou3519 zou3519 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thank you @rohan-varma!

@rohan-varma
Copy link
Contributor Author

@pytorchbot test this please

@zou3519
Copy link
Contributor

zou3519 commented Aug 23, 2018

@pytorchbot retest this please

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zou3519 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

PenghuiCheng pushed a commit to PenghuiCheng/pytorch that referenced this pull request Sep 11, 2018
Summary:
Resolving [https://github.com/pytorch/pytorch/issues/10741](https://github.com/pytorch/pytorch/issues/10741). The current docs use `num_directions` quite a bit, without any explanation for them. `num_directions` is set to 2 if the RNN is bidirectional, or 1 otherwise. This change simply adds that to the docs.
Pull Request resolved: pytorch#10786

Differential Revision: D9480235

Pulled By: zou3519

fbshipit-source-id: f61d1b0d2b943f84d5b7ff83df6fe0965a508a5e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants