code: def forward(
      model: Model[InT, InT], X: InT, is_train: bool
  ) -> Tuple[InT, Callable]:
      N, mu, var = _get_moments(model.ops, X)
      Xhat = (X - mu) * var ** (-1.0 / 2.0)
      Y, backprop_rescale = _begin_update_scale_shift(model, Xhat)
  
      def backprop(dY: InT) -> InT:
          dY = backprop_rescale(dY)
          dist, sum_dy, sum_dy_dist = _get_d_moments(
              model.ops, dY, X, mu
          )
          d_xhat = N * dY - sum_dy - dist * var ** (-1.0) * sum_dy_dist
          d_xhat *= var ** (-1.0 / 2)
          d_xhat /= N
          return d_xhat
  
      return Y, backprop
  
file_path: thinc/thinc/layers/layernorm.py
imports: from typing import Callable, Optional, Tuple, cast
  from ..backends import Ops
  from ..config import registry
  from ..model import Model
  from ..types import Floats2d
  from ..util import get_width
label_desc: Use image node_id 2 for calling a global function with example usage: forward(model, X, is_train) and returns: Y,  backprop, d_xhat