code: def weight_decay(p, lr, wd, do_wd=True, **kwargs):
      "Weight decay as decaying `p` with `lr*wd`"
      if do_wd and wd != 0:
          p.data.mul_(1 - lr * wd)
  
imports: from __future__ import annotations
  from .torch_basics import *
label_desc: Use image node_id 3 for calling a global function with example usage: weight_decay(p, lr, wd, do_wd) without return types