Skip to content

Commit

Permalink
[Fix] Remove list self.layers in hrformer ffn modules (#2449)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben-Louis authored Jun 12, 2023
1 parent d1621e9 commit 442df64
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions mmpose/models/backbones/hrformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,17 +299,12 @@ def __init__(self,
self.act3 = build_activation_layer(act_cfg)
self.norm3 = build_norm_layer(norm_cfg, out_features)[1]

# put the modules togather
self.layers = [
self.fc1, self.norm1, self.act1, self.dw3x3, self.norm2, self.act2,
self.fc2, self.norm3, self.act3
]

def forward(self, x, H, W):
"""Forward function."""
x = nlc_to_nchw(x, (H, W))
for layer in self.layers:
x = layer(x)
x = self.act1(self.norm1(self.fc1(x)))
x = self.act2(self.norm2(self.dw3x3(x)))
x = self.act3(self.norm3(self.fc2(x)))
x = nchw_to_nlc(x)
return x

Expand Down

0 comments on commit 442df64

Please sign in to comment.