code: def forward(
      model: Model[InT, OutT], Xr: InT, is_train: bool
  ) -> Tuple[OutT, Callable]:
      Y, which = model.ops.reduce_max(
          cast(Floats2d, Xr.data), Xr.lengths
      )
      lengths = Xr.lengths
      array_info = ArrayInfo.from_array(Y)
  
      def backprop(dY: OutT) -> InT:
          array_info.check_consistency(dY)
          return Ragged(
              model.ops.backprop_reduce_max(dY, which, lengths), lengths
          )
  
      return Y, backprop
  
imports: from typing import Callable, Tuple, cast
  from ..config import registry
  from ..model import Model
  from ..types import Floats2d, Ragged
  from ..util import ArrayInfo
label_desc: Use image node_id 2 for calling a global function with example usage: forward(model, Xr, is_train) and returns: Y,  backprop, Ragged