| 70 | expansion = 4 |
| 71 | |
| 72 | def __init__(self, inplanes, planes, stride=1, downsample=None): |
| 73 | super(Bottleneck, self).__init__() |
| 74 | self.conv1 = nn.Conv2d(inplanes, planes, kernel_size=1, groups=2, bias=False) |
| 75 | self.bn1 = nn.BatchNorm2d(planes) |
| 76 | self.conv2 = nn.Conv2d(planes, planes, kernel_size=3, stride=stride, |
| 77 | padding=1, groups=2, bias=False) |
| 78 | self.bn2 = nn.BatchNorm2d(planes) |
| 79 | self.conv3 = nn.Conv2d(planes, planes * 4, kernel_size=1, groups=2, bias=False) |
| 80 | self.bn3 = nn.BatchNorm2d(planes * 4) |
| 81 | self.relu = nn.ReLU(inplace=True) |
| 82 | self.downsample = downsample |
| 83 | self.stride = stride |
| 84 | |
| 85 | def forward(self, x): |
| 86 | residual = x |