def __init__()

in losses.py [0:0]


    def __init__(self, requires_grad=False, which_layer=16):
        """Init function, compute the VGG feature of an input at certain layer.
        A simple illustration of VGG network is conv->conv->maxpool->conv->conv
        ->maxpool->conv->conv->conv->maxpool (layer 16)->conv->conv->conv->
        maxpool->conv->conv->conv->maxpool.

        Parameters
        ----------
        requires_grad : bool
        which_layer : int
        """
        super(Vgg16, self).__init__()
        vgg_pretrained_features = models.vgg16(pretrained=True).features

        self.slice1 = torch.nn.Sequential()
        self.slice2 = torch.nn.Sequential()
        self.slice3 = torch.nn.Sequential()
        self.slice4 = torch.nn.Sequential()
        self.slice5 = torch.nn.Sequential()

        for x in range(4):
            self.slice1.add_module(str(x), vgg_pretrained_features[x])
        for x in range(4, 9):
            self.slice2.add_module(str(x), vgg_pretrained_features[x])
        for x in range(9, 16):
            self.slice3.add_module(str(x), vgg_pretrained_features[x])
        for x in range(16, 23):
            self.slice4.add_module(str(x), vgg_pretrained_features[x])
        for x in range(23, 31):
            self.slice5.add_module(str(x), vgg_pretrained_features[x])

        if not requires_grad:
            for param in self.parameters():
                param.requires_grad = False