From 40d42557d40d2f9ce914123137fde1e23b5303b3 Mon Sep 17 00:00:00 2001 From: noahcao Date: Thu, 15 Jul 2021 17:29:47 +0800 Subject: [PATCH] delete unnecessary code --- models/transformer.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/models/transformer.py b/models/transformer.py index 2853a43..6a30300 100644 --- a/models/transformer.py +++ b/models/transformer.py @@ -111,12 +111,9 @@ def forward(self, tgt, memory, pos=pos, query_pos=query_pos) if self.return_intermediate: intermediate.append(self.norm(output)) - + if self.norm is not None: output = self.norm(output) - if self.return_intermediate: - intermediate.pop() - intermediate.append(output) if self.return_intermediate: return torch.stack(intermediate)