code: def forward(
      model: Model[Floats2d, Floats2d], X: Floats2d, is_train: bool
  ) -> Tuple[Floats2d, Callable]:
      W = cast(Floats2d, model.get_param("W"))
      b = cast(Floats1d, model.get_param("b"))
      Y_preact = model.ops.affine(X, W, b)
      Y = model.ops.hard_swish(Y_preact)
  
      def backprop(dY: Floats2d) -> Floats2d:
          dY = model.ops.backprop_hard_swish(
              dY, Y_preact, inplace=False
          )
          model.inc_grad("b", dY.sum(axis=0))
          model.inc_grad("W", model.ops.gemm(dY, X, trans1=True))
          return model.ops.gemm(dY, W)
  
      return Y, backprop
  
file_path: thinc/thinc/layers/hard_swish.py
imports: from typing import Callable, Optional, Tuple, cast
  from ..config import registry
  from ..initializers import he_normal_init, zero_init
  from ..model import Model
  from ..types import Floats1d, Floats2d
  from ..util import get_width, partial
  from .chain import chain
  from .dropout import Dropout
  from .layernorm import LayerNorm
label_desc: Use image node_id 2 for calling a global function with example usage: forward(model, X, is_train) and returns: Y,  backprop, model