From 10bde717e51c95cdf20135c8bba77a7a1b00d78c Mon Sep 17 00:00:00 2001 From: Fredo Guan Date: Sun, 5 Feb 2023 02:11:28 -0800 Subject: [PATCH] Update metaformers.py --- timm/models/metaformers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timm/models/metaformers.py b/timm/models/metaformers.py index db9421dc..01c4ee5f 100644 --- a/timm/models/metaformers.py +++ b/timm/models/metaformers.py @@ -583,8 +583,8 @@ class MetaFormer(nn.Module): def forward_head(self, x, pre_logits: bool = False): # NOTE nn.Sequential in head broken down since can't call head[:-1](x) in torchscript :( x = self.head.global_pool(x) + x = self.head.norm(x.permute(0, 2, 3, 1)).permute(0, 3, 1, 2) x = self.head.flatten(x) - x = self.head.norm(x) return x if pre_logits else self.head.fc(x) def forward_features(self, x):