Open liorkad3 opened 3 years ago
This happens in the last bottleneck only, where depth and channels are both the same and stride is not set (so defaults to 1), right? As far as I know it's only a single occurrence in the model and maybe libtorch automatically optimises for it. Otherwise, try:
if in_channel == depth:
if stride == 1:
self.shortcut_layer = Identity()
else:
self.shortcut_layer = MaxPool2d(1, stride)
In the Bottleneck_IR_SE , the shortcut layer of Maxpool is always with kernel=1 and stride=1. So the layer is useless. Am I missing something?