code: def larc_layer_lr(p, lr, trust_coeff, wd, eps, clip=True, **kwargs):
      "Computes the local lr before weight decay is applied"
      p_norm, g_norm = torch.norm(p.data), torch.norm(p.grad.data)
      local_lr = (
          lr * trust_coeff * (p_norm) / (g_norm + p_norm * wd + eps)
      )
      return {"local_lr": min(lr, local_lr) if clip else local_lr}
  
imports: from __future__ import annotations
  from .torch_basics import *
label_desc: Use image node_id 19 for calling a global function with example usage: larc_layer_lr(p, lr, trust_coeff, wd, eps, clip) and returns: dict