提交 15eea58c 编写于 作者: C chengduoZH

update transformer

上级 14285daa
...@@ -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.
先完成此消息的编辑!
想要评论请 注册