def METHOD_NAME(self, block, planes, blocks, stride, groups, base_width):
    downsample = None
    if stride != 1 or self.inplanes != planes * block.expansion:
        if stride == 2:
            downsample = nn.Sequential(
                nn.AvgPool2d(kernel_size=2, stride=2, padding=0),
                conv1x1(self.inplanes, planes * block.expansion, 1),
                nn.BatchNorm2d(planes * block.expansion),
            )
        elif stride == 1:
            downsample = nn.Sequential(
                conv1x1(self.inplanes, planes * block.expansion, stride),
                nn.BatchNorm2d(planes * block.expansion),
            )
        else:
            raise ValueError("invalid stride [{:}] for downsample".format(stride))
    layers = []
    layers.append(
        block(self.inplanes, planes, stride, downsample, groups, base_width)
    )
    self.inplanes = planes * block.expansion
    for _ in range(1, blocks):
        layers.append(block(self.inplanes, planes, 1, None, groups, base_width))
    return nn.Sequential(*layers)