def METHOD_NAME(self, block, planes, blocks, stride=1):
    downsample = None
    if stride != 1 or self.inplanes != planes * block.expansion:
        downsample = Sequential(
            conv1x1(self.inplanes, planes * block.expansion, stride),
            BatchNorm2d(planes * block.expansion),
        )
    layers = []
    layers.append(block(self.inplanes, planes, stride, downsample))
    self.inplanes = planes * block.expansion
    for _ in range(1, blocks):
        layers.append(block(self.inplanes, planes))
    return Sequential(*layers)