Skip to content

Commit ded1671

Browse files
committed
Fix stochastic depth working only with a shortcut
1 parent 54a6cca commit ded1671

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

timm/models/rexnet.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,11 @@ def forward(self, x):
8989
x = self.se(x)
9090
x = self.act_dw(x)
9191
x = self.conv_pwl(x)
92-
if self.drop_path is not None:
93-
x = self.drop_path(x)
9492
if self.use_shortcut:
95-
x[:, 0:self.in_channels] += shortcut
93+
if self.drop_path is not None:
94+
x = self.drop_path(x)
95+
96+
x[:, 0:self.in_channels] += shortcut
9697
return x
9798

9899

0 commit comments

Comments
 (0)