def METHOD_NAME(self):
    self.set_to_train()
    if self.do_adv_alone:
        no_grad_list = ["trunk", "classifier"]
    elif self.do_metric_alone:
        no_grad_list = ["generator"]
    else:
        no_grad_list = []
    for k in self.models.keys():
        if k in no_grad_list:
            c_f.set_requires_grad(self.models[k], requires_grad=False)
            self.models[k].eval()
        else:
            c_f.set_requires_grad(self.models[k], requires_grad=True)