def __init__(self, c_dim, normalize=True, use_linear=True):
    super().__init__()
    self.normalize = normalize
    self.use_linear = use_linear
    self.features = models.resnet18(pretrained=True)
    self.features.fc = nn.Sequential()
    if use_linear:
        self.fc = nn.Linear(512, c_dim)
    elif (c_dim == 512):
        self.fc = nn.Sequential()
    else:
        raise ValueError('c_dim must be 512 if use_linear is False')
def __init__(self, c_dim, normalize=True, use_linear=True):
    super().__init__()
    self.normalize = normalize
    self.use_linear = use_linear
    self.features = models.resnet18(pretrained=True)
    self.features.fc = nn.Sequential()
    if use_linear:
        self.fc = nn.Linear(512, c_dim)
    elif (c_dim == 512):
        self.fc = nn.Sequential()
    else:
        raise ValueError('c_dim must be 512 if use_linear is False')