From 232e0b6836a703f416967a1f864946c55dd7bb03 Mon Sep 17 00:00:00 2001 From: ZheyuYe Date: Thu, 30 Jul 2020 01:05:17 +0800 Subject: [PATCH] update --- src/gluonnlp/models/transformer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gluonnlp/models/transformer.py b/src/gluonnlp/models/transformer.py index 9f1b9e57d7..ea8940d8d3 100644 --- a/src/gluonnlp/models/transformer.py +++ b/src/gluonnlp/models/transformer.py @@ -1402,6 +1402,8 @@ def hybrid_forward(self, F, step_data, states): step_data = step_data * np.sqrt(self.model.dec_units) if self.model.pos_embed_type is not None: step_data = step_data + self.model.tgt_pos_embed_layer(position) + if self.model.layernorm_embedding: + step_data = self.tgt_embed_ln(step_data) out, new_states =\ self.model.decoder.incremental_decode(F, step_data, dec_states, mem_data, mem_valid_length)