未验证 提交 d9f2dd3f 编写于 作者: C chengduo 提交者: GitHub

Merge pull request #1382 from chengduoZH/release/0.15.0

Fix transformer model
...@@ -203,6 +203,7 @@ def prepare_encoder(src_word, ...@@ -203,6 +203,7 @@ def prepare_encoder(src_word,
size=[src_max_len, src_emb_dim], size=[src_max_len, src_emb_dim],
param_attr=fluid.ParamAttr( param_attr=fluid.ParamAttr(
name=pos_enc_param_name, trainable=False)) name=pos_enc_param_name, trainable=False))
src_pos_enc.stop_gradient = True
enc_input = src_word_emb + src_pos_enc enc_input = src_word_emb + src_pos_enc
return layers.dropout( return layers.dropout(
enc_input, enc_input,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册