code: def SGD(
      params: Tensor | Iterable,  # Model parameters
      lr: float | slice,  # Default learning rate
      mom: float = 0.0,  # Gradient moving average (β1) coefficient
      wd: Real = 0.0,  # Optional weight decay (true or L2)
      decouple_wd: bool = True,  # Apply true weight decay or L2 regularization (SGD)
  ) -> Optimizer:
      "A SGD `Optimizer`"
      cbs = [weight_decay] if decouple_wd else [l2_reg]
      if mom != 0:
          cbs.append(average_grad)
      cbs.append(sgd_step if mom == 0 else momentum_step)
      return Optimizer(params, cbs, lr=lr, mom=mom, wd=wd)
  
imports: from __future__ import annotations
  from .torch_basics import *
label_desc: Use image node_id 8 for calling a global function with example usage: SGD(params, lr, mom, wd, decouple_wd) and returns: Optimizer