Skip to content

Commit d516ace

Browse files
authored
Merge pull request #11364 from jshower/develop
Correct the use of the lstm layer
2 parents cdc06b0 + 22f80cc commit d516ace

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

python/paddle/fluid/tests/book/test_label_semantic_roles.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ def db_lstm(word, predicate, ctx_n2, ctx_n1, ctx_0, ctx_p1, ctx_p2, mark,
7676
emb_layers.append(mark_embedding)
7777

7878
hidden_0_layers = [
79-
fluid.layers.fc(input=emb, size=hidden_dim, act='tanh')
80-
for emb in emb_layers
79+
fluid.layers.fc(input=emb, size=hidden_dim) for emb in emb_layers
8180
]
8281

8382
hidden_0 = fluid.layers.sums(input=hidden_0_layers)
@@ -94,8 +93,8 @@ def db_lstm(word, predicate, ctx_n2, ctx_n1, ctx_0, ctx_p1, ctx_p2, mark,
9493

9594
for i in range(1, depth):
9695
mix_hidden = fluid.layers.sums(input=[
97-
fluid.layers.fc(input=input_tmp[0], size=hidden_dim, act='tanh'),
98-
fluid.layers.fc(input=input_tmp[1], size=hidden_dim, act='tanh')
96+
fluid.layers.fc(input=input_tmp[0], size=hidden_dim),
97+
fluid.layers.fc(input=input_tmp[1], size=hidden_dim)
9998
])
10099

101100
lstm = fluid.layers.dynamic_lstm(

0 commit comments

Comments
 (0)