code: def forward(
      model: Model[InT, OutT], Xp: InT, is_train: bool
  ) -> Tuple[OutT, Callable[[OutT], InT]]:
      Ys = cast(OutT, model.ops.padded2list(Xp))
  
      def backprop(dYs: OutT) -> InT:
          dYp = model.ops.list2padded(dYs)
          assert isinstance(dYp, Padded)
          return dYp
  
      return Ys, backprop
  
imports: from typing import Callable, Tuple, TypeVar, cast
  from ..config import registry
  from ..model import Model
  from ..types import List2d, Padded
label_desc: Use image node_id 2 for calling a global function with example usage: forward(model, Xp, is_train) and returns: Ys,  backprop, dYp