def METHOD_NAME(self, models, optimizer, how_to_zero):
    if how_to_zero == "none":
        for model in models:
            for param in model.parameters():
                param.grad = None
    elif how_to_zero == "model":
        for model in models:
            model.METHOD_NAME()
    elif how_to_zero == "optimizer":
        optimizer.METHOD_NAME()