def METHOD_NAME(self, closure=None, scale=1.0, groups=None):
    """Performs a single optimization step."""
    if self.supports_step_with_scale:
        if self.supports_groups:
            self.optimizer.METHOD_NAME(closure, scale=scale, groups=groups)
        else:
            self.optimizer.METHOD_NAME(closure, scale=scale)
    else:
        if scale != 1.0:
            self.multiply_grads(1.0 / scale)
        if self.supports_groups:
            self.optimizer.METHOD_NAME(closure, groups=groups)
        else:
            self.optimizer.METHOD_NAME(closure)