class_docstr: Implements SWATS Optimizer Algorithm.
  It has been proposed in `Improving Generalization Performance by
  Switching from Adam to SGD`__.
  
  Arguments:
      params: iterable of parameters to optimize or dicts defining
          parameter groups
      lr: learning rate (default: 1e-2)
      betas: coefficients used for computing
          running averages of gradient and its square (default: (0.9, 0.999))
      eps: term added to the denominator to improve
          numerical stability (default: 1e-3)
      weight_decay: weight decay (L2 penalty) (default: 0)
      amsgrad: whether to use the AMSGrad variant of this
          algorithm from the paper `On the Convergence of Adam and Beyond`
          (default: False)
      nesterov: enables Nesterov momentum (default: False)
  
  
  Example:
      >>> import torch_optimizer as optim
      >>> optimizer = optim.SWATS(model.parameters(), lr=0.01)
      >>> optimizer.zero_grad()
      >>> loss_fn(model(input), target).backward()
      >>> optimizer.step()
  
  __ https://arxiv.org/pdf/1712.07628.pdf
  
  Note:
      Reference code: https://github.com/Mrpatekful/swats
code: def __setstate__(self, state: State) -> None:
      super().__setstate__(state)
      for group in self.param_groups:
          group.setdefault("amsgrad", False)
          group.setdefault("nesterov", False)
  
imports: import torch
  from torch.optim.optimizer import Optimizer
  from .types import Betas2, OptFloat, OptLossClosure, Params, State
label_desc: Use image node_id 2 for calling the SWATS obj's underlying member method code with example usage: obj.__setstate__(state) without return types