def step(self, closure: callable=None):
    'Performs a single optimization step.\n\n        Arguments:\n            closure (callable, optional): A closure that reevaluates the model\n                and returns the loss.\n        '
    loss = None
    if (closure is not None):
        loss = closure()
    iteration_group = 0
    for group in self.param_groups:
        iteration_group += 1
        weight_decay = group['weight_decay']
        momentum = group['momentum']
        dampening = group['dampening']
        nesterov = group['nesterov']
        for (p_index, p) in enumerate(group['params']):
            if (p.grad is None):
                continue
            d_p = p.grad.data
            if (weight_decay != 0):
                d_p.add_(p.data, alpha=weight_decay)
            if (momentum != 0):
                param_state = self.state[p]
                if ('momentum_buffer' not in param_state):
                    buf = param_state['momentum_buffer'] = torch.clone(d_p).detach()
                else:
                    buf = param_state['momentum_buffer']
                    buf.mul_(momentum).add_(d_p, alpha=(1 - dampening))
                if nesterov:
                    d_p = d_p.add(momentum, buf)
                else:
                    d_p = buf
            p.data.add_(d_p, alpha=(- self.lr_vector[p_index]))
    return loss
Performs a single optimization step.

Arguments:
    closure (callable, optional): A closure that reevaluates the model
        and returns the loss.
def step(self, closure: callable=None):
    'Performs a single optimization step.\n\n        Arguments:\n            closure (callable, optional): A closure that reevaluates the model\n                and returns the loss.\n        '
    loss = None
    if (closure is not None):
        loss = closure()
    iteration_group = 0
    for group in self.param_groups:
        iteration_group += 1
        weight_decay = group['weight_decay']
        momentum = group['momentum']
        dampening = group['dampening']
        nesterov = group['nesterov']
        for (p_index, p) in enumerate(group['params']):
            if (p.grad is None):
                continue
            d_p = p.grad.data
            if (weight_decay != 0):
                d_p.add_(p.data, alpha=weight_decay)
            if (momentum != 0):
                param_state = self.state[p]
                if ('momentum_buffer' not in param_state):
                    buf = param_state['momentum_buffer'] = torch.clone(d_p).detach()
                else:
                    buf = param_state['momentum_buffer']
                    buf.mul_(momentum).add_(d_p, alpha=(1 - dampening))
                if nesterov:
                    d_p = d_p.add(momentum, buf)
                else:
                    d_p = buf
            p.data.add_(d_p, alpha=(- self.lr_vector[p_index]))
    return loss