code: def forward(
      model: Model[InT, OutT], X: InT, is_train: bool
  ) -> Tuple[OutT, Callable]:
      l2r, r2l = model.layers
      X_rev = _reverse(model.ops, X)
      l2r_Z, bp_l2r_Z = l2r(X, is_train)
      r2l_Z, bp_r2l_Z = r2l(X_rev, is_train)
      Z = _concatenate(model.ops, l2r_Z, r2l_Z)
  
      def backprop(dZ: OutT) -> InT:
          d_l2r_Z, d_r2l_Z = _split(model.ops, dZ)
          dX_l2r = bp_l2r_Z(d_l2r_Z)
          dX_r2l = bp_r2l_Z(d_r2l_Z)
          return _sum(dX_l2r, dX_r2l)
  
      return Z, backprop
  
file_path: thinc/thinc/layers/bidirectional.py
imports: from typing import Callable, Optional, Tuple, cast
  from ..backends import Ops
  from ..config import registry
  from ..model import Model
  from ..types import Padded
label_desc: Use image node_id 2 for calling a global function with example usage: forward(model, X, is_train) and returns: Z,  backprop, _sum