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

Merge pull request #1314 from chengduoZH/update_transformer2

Update transformer
...@@ -219,6 +219,7 @@ def prepare_encoder_decoder(src_word, ...@@ -219,6 +219,7 @@ def prepare_encoder_decoder(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.
先完成此消息的编辑!
想要评论请 注册