-
Notifications
You must be signed in to change notification settings - Fork 24.3k
[docs] added num_directions explanation to docstrings #10786
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
Conversation
@@ -368,6 +369,7 @@ class LSTM(RNNBase): | |||
: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.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
There was a problem hiding this 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!
@pytorchbot test this please |
@pytorchbot retest this please |
There was a problem hiding this 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.
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
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.