code: def rms_norm(
      x: torch.Tensor,
      normalized_shape: List[int],
      weight: Optional[torch.Tensor] = None,
      eps: float = 1e-5,
  ):
      norm_ndim = len(normalized_shape)
      if torch.jit.is_scripting():
          # ndim = len(x.shape)
          # dims = list(range(ndim - norm_ndim, ndim))  # this doesn't work on pytorch <= 1.13.x
          # NOTE -ve dims cause torchscript to crash in some cases, out of options to work around
          assert norm_ndim == 1
          v = torch.var(x, dim=-1).unsqueeze(
              -1
          )  # ts crashes with -ve dim + keepdim=True
      else:
          dims = tuple(range(-1, -norm_ndim - 1, -1))
          v = torch.var(x, dim=dims, keepdim=True)
      x = x * torch.rsqrt(v + eps)
      if weight is not None:
          x = x * weight
      return x
  
file_path: pytorch-image-models/timm/layers/fast_norm.py
imports: from typing import List, Optional
  import torch
  from torch.nn import functional
label_desc: Use image node_id 5 for calling a global function with example usage: rms_norm(x, normalized_shape, weight, eps) and returns: x