Skip to content

Commit

Permalink
Fix unit test for lstm_unit.
Browse files Browse the repository at this point in the history
  • Loading branch information
pkuyym committed Jan 3, 2018
1 parent c0f6f49 commit 60fecce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions python/paddle/v2/fluid/layers/nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -1199,9 +1199,12 @@ def lstm_unit(x_t,
This layer has two outputs including :math:`h_t` and :math:`o_t`.
Args:
x_t (Variable): The input value of current step, a 2-D tensor.
hidden_t_prev (Variable): The hidden value of lstm unit, a 2-D tensor.
cell_t_prev (Variable): The cell value of lstm unit, a 2-D tensor.
x_t (Variable): The input value of current step, a 2-D tensor with shape
M x N, M for batch size and N for input size.
hidden_t_prev (Variable): The hidden value of lstm unit, a 2-D tensor
with shape M x S, M for batch size and S for size of lstm unit.
cell_t_prev (Variable): The cell value of lstm unit, a 2-D tensor with
shape M x S, M for batch size and S for size of lstm unit.
forget_bias (float): The forget bias of lstm unit.
param_attr (ParamAttr): The attributes of parameter weights, used to set
initializer, name etc.
Expand Down
4 changes: 2 additions & 2 deletions python/paddle/v2/fluid/tests/test_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ def test_lstm_unit(self):
name='x_t_data', shape=[10, 10], dtype='float32')
x_t = layers.fc(input=x_t_data, size=10)
prev_hidden_data = layers.data(
name='prev_hidden_data', shape=[10, 20], dtype='float32')
prev_hidden = layers.fc(input=prev_hidden_data, size=20)
name='prev_hidden_data', shape=[10, 30], dtype='float32')
prev_hidden = layers.fc(input=prev_hidden_data, size=30)
prev_cell_data = layers.data(
name='prev_cell', shape=[10, 30], dtype='float32')
prev_cell = layers.fc(input=prev_cell_data, size=30)
Expand Down

0 comments on commit 60fecce

Please sign in to comment.