Fix bug in forward_embedding
Summary:
See:
Pull Request resolved:
@@ -353,7 +353,7 @@ class TransformerEncoder(FairseqEncoder):
def forward_embedding(self, src_tokens):
# embed tokens and positions
- embed = self.embed_scale * self.embed_tokens(src_tokens)
+ x = embed = self.embed_scale * self.embed_tokens(src_tokens)
if self.embed_positions is not None:
x = embed + self.embed_positions(src_tokens)
if self.layernorm_embedding:
