# Codeblock 3b if self.add_channel or self.downsample: #(1) self.projection = nn.Conv2d(in_channels=in_channels, #(2) out_channels=out_channels, kernel_size=1, stride=stride, padding=0, bias=False) nn.init.kaiming_normal_(self.projection.weight, nonlinearity='relu') self.bn_proj = nn.BatchNorm2d(num_features=out_channels) self.conv0 = nn.Conv2d(in_channels=in_channels, #(3) out_channels=mid_channels, #(4) kernel_size=1, stride=1, padding=0, bias=False) nn.init.kaiming_normal_(self.conv0.weight, nonlinearity='relu') self.bn0 = nn.BatchNorm2d(num_features=mid_channels) self.conv1 = nn.Conv2d(in_channels=mid_channels, #(5) out_channels=mid_channels, kernel_size=3, stride=stride, #(6) padding=1, bias=False, groups=CARDINALITY) #(7) nn.init.kaiming_normal_(self.conv1.weight, nonlinearity='relu') self.bn1 = nn.BatchNorm2d(num_features=mid_channels) self.conv2 = nn.Conv2d(in_channels=mid_channels, #(8) out_channels=out_channels, #(9) kernel_size=1, stride=1, padding=0, bias=False) nn.init.kaiming_normal_(self.conv2.weight, nonlinearity='relu') self.bn2 = nn.BatchNorm2d(num_features=out_channels) self.relu = nn.ReLU()