def METHOD_NAME(self, pretrain=True):
    if pretrain:
        url = model_urls["resnet{}".format(self.depth)]
        pretrained_state_dict = model_zoo.load_url(url)
        print("=> loading pretrained model {}".format(url))
        self.load_state_dict(pretrained_state_dict, strict=False)
    else:
        for m in self.modules():
            if self.activation == "LeakyReLU":
                nonlinearity = "leaky_relu"
            else:
                nonlinearity = "relu"
            if isinstance(m, nn.Conv2d):
                nn.init.kaiming_normal_(
                    m.weight, mode="fan_out", nonlinearity=nonlinearity
                )
            elif isinstance(m, nn.BatchNorm2d):
                m.weight.data.fill_(1)
                m.bias.data.zero_()