Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
add warning on input data for RNN for layout NTC
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasDelteil authored and piiswrong committed Apr 30, 2018
1 parent 6d7c39e commit 36f3422
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions python/mxnet/gluon/rnn/rnn_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,10 @@ class RNN(_RNNLayer):
Inputs:
- **data**: input tensor with shape `(sequence_length, batch_size, input_size)`
when `layout` is "TNC". For other layouts dimensions are permuted accordingly.
Be aware that a `transpose` operation with a ndarray results in a new allocation of
memory. For optimal performance and when applicable, consider transposing
your layout to "TNC" before loading your data into
a ndarray.
- **states**: initial recurrent state tensor with shape
`(num_layers, batch_size, num_hidden)`. If `bidirectional` is True,
shape will instead be `(2*num_layers, batch_size, num_hidden)`. If
Expand Down Expand Up @@ -386,6 +390,10 @@ class LSTM(_RNNLayer):
Inputs:
- **data**: input tensor with shape `(sequence_length, batch_size, input_size)`
when `layout` is "TNC". For other layouts dimensions are permuted accordingly.
Be aware that a `transpose` operation with a ndarray results in a new allocation of
memory. For optimal performance and when applicable, consider transposing
your layout to "TNC" before loading your data into
a ndarray.
- **states**: a list of two initial recurrent state tensors. Each has shape
`(num_layers, batch_size, num_hidden)`. If `bidirectional` is True,
shape will instead be `(2*num_layers, batch_size, num_hidden)`. If
Expand Down Expand Up @@ -483,6 +491,10 @@ class GRU(_RNNLayer):
Inputs:
- **data**: input tensor with shape `(sequence_length, batch_size, input_size)`
when `layout` is "TNC". For other layouts dimensions are permuted accordingly.
Be aware that a `transpose` operation with a ndarray results in a new allocation of
memory. For optimal performance and when applicable, consider transposing
your layout to "TNC" before loading your data into
a ndarray.
- **states**: initial recurrent state tensor with shape
`(num_layers, batch_size, num_hidden)`. If `bidirectional` is True,
shape will instead be `(2*num_layers, batch_size, num_hidden)`. If
Expand Down

0 comments on commit 36f3422

Please sign in to comment.