(self, inplanes, planes, stride=1, downsample=None, groups=1,
base_width=64, dilation=1, norm_layer=None)
| 31 | expansion = 1 |
| 32 | |
| 33 | def __init__(self, inplanes, planes, stride=1, downsample=None, groups=1, |
| 34 | base_width=64, dilation=1, norm_layer=None): |
| 35 | super(BasicBlock, self).__init__() |
| 36 | if norm_layer is None: |
| 37 | norm_layer = nn.BatchNorm2d |
| 38 | if groups != 1 or base_width != 64: |
| 39 | raise ValueError('BasicBlock only supports groups=1 and base_width=64') |
| 40 | if dilation > 1: |
| 41 | raise NotImplementedError("Dilation > 1 not supported in BasicBlock") |
| 42 | # Both self.conv1 and self.downsample layers downsample the input when stride != 1 |
| 43 | self.conv1 = conv3x3(inplanes, planes, stride) |
| 44 | self.bn1 = norm_layer(planes) |
| 45 | self.relu = nn.ReLU(inplace=True) |
| 46 | self.conv2 = conv3x3(planes, planes) |
| 47 | self.bn2 = norm_layer(planes) |
| 48 | self.downsample = downsample |
| 49 | self.stride = stride |
| 50 | |
| 51 | def forward(self, x): |
| 52 | identity = x |
nothing calls this directly
no test coverage detected