From c8f06383adefe8047ea96a10474fb28ee14eba9a Mon Sep 17 00:00:00 2001 From: chengduoZH Date: Thu, 27 Sep 2018 16:23:27 +0800 Subject: [PATCH] update transformer --- fluid/neural_machine_translation/transformer/model.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fluid/neural_machine_translation/transformer/model.py b/fluid/neural_machine_translation/transformer/model.py index fc76dbbd..ee2d1d50 100644 --- a/fluid/neural_machine_translation/transformer/model.py +++ b/fluid/neural_machine_translation/transformer/model.py @@ -639,7 +639,8 @@ def wrap_decoder(trg_vocab_size, if weight_sharing: predict = layers.matmul( x=dec_output, - y=fluid.get_var(word_emb_param_names[0]), + y=fluid.default_main_program().global_block().var( + word_emb_param_names[0]), transpose_y=True) else: predict = layers.fc(input=dec_output, -- GitLab