From 8ca89039182e4f46681346c93f4586c7c3dc8a35 Mon Sep 17 00:00:00 2001 From: guosheng Date: Wed, 4 Apr 2018 17:06:34 +0800 Subject: [PATCH] Fix the merged conflicts in Transformer inference --- fluid/neural_machine_translation/transformer/infer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fluid/neural_machine_translation/transformer/infer.py b/fluid/neural_machine_translation/transformer/infer.py index 0866efd8..2338975f 100644 --- a/fluid/neural_machine_translation/transformer/infer.py +++ b/fluid/neural_machine_translation/transformer/infer.py @@ -203,7 +203,7 @@ def translate_batch(exe, predict_all = np.log( predict_all.reshape([len(beam_inst_map) * beam_size, i + 1, -1]) [:, -1, :]) - predict_all = (predict_all + scores[beam_inst_map].reshape( + predict_all = (predict_all + scores[active_beams].reshape( [len(beam_inst_map) * beam_size, -1])).reshape( [len(beam_inst_map), beam_size, -1]) if not output_unk: # To exclude the token. -- GitLab