code: def _single_tensor_sgdw(
      params: List[Tensor],
      d_p_list: List[Tensor],
      momentum_buffer_list: List[Optional[Tensor]],
      *,
      weight_decay: float,
      momentum: float,
      lr: float,
      dampening: float,
      nesterov: bool,
      maximize: bool,
      has_sparse_grad: bool,
  ):
      for i, param in enumerate(params):
          d_p = d_p_list[i] if not maximize else -d_p_list[i]
  
          param.mul_(1.0 - lr * weight_decay)
  
          if momentum != 0:
              buf = momentum_buffer_list[i]
  
              if buf is None:
                  buf = torch.clone(d_p).detach()
                  momentum_buffer_list[i] = buf
              else:
                  buf.mul_(momentum).add_(d_p, alpha=1 - dampening)
  
              if nesterov:
                  d_p = d_p.add(buf, alpha=momentum)
              else:
                  d_p = buf
  
          param.add_(d_p, alpha=-lr)
  
file_path: pytorch-image-models/timm/optim/sgdw.py
imports: from functools import update_wrapper, wraps
  import torch
  from torch import Tensor
  from torch.optim.optimizer import Optimizer
  from typing import List, Optional
label_desc: Use image node_id 2 for calling a global function with example usage: _single_tensor_sgdw(params, d_p_list, momentum_buffer_list) without return types