in models/modules/static_layers.py [0:0]
def forward(self, x):
in_channel = x.size(1)
if self.mobile_inverted_conv is None: # or isinstance(self.mobile_inverted_conv, ZeroLayer):
res = x
elif self.shortcut is None: # or isinstance(self.shortcut, ZeroLayer):
res = self.mobile_inverted_conv(x)
else:
im = self.shortcut(x)
x = self.mobile_inverted_conv(x)
if self.drop_connect_rate > 0 and in_channel == im.size(1) and self.shortcut.reduction == 1:
x = drop_connect(x, p=self.drop_connect_rate, training=self.training)
res = x + im
return res