code: def forward_v2(
      model: Model[InT, OutT], inputs: InT, is_train: bool
  ) -> Tuple[OutT, Callable]:
      table = model.attrs["mapping_table"]
      if table is None:
          raise ValueError("'mapping table' not set")
      default = model.attrs["default"]
      column = model.attrs["column"]
      if is_xp_array(inputs):
          xp_input = True
          if column is not None:
              idx = to_numpy(cast(Ints2d, inputs)[:, column])
          else:
              idx = to_numpy(inputs)
      else:
          xp_input = False
          idx = inputs
      values = [table.get(x, default) for x in idx]
      arr = model.ops.asarray2i(values, dtype="i")
      output = model.ops.reshape2i(arr, -1, 1)
  
      def backprop(dY: OutT) -> InT:
          if xp_input:
              return model.ops.xp.empty(dY.shape)  # type: ignore
          else:
              return []
  
      return output, backprop
  
file_path: thinc/thinc/layers/remap_ids.py
imports: from typing import Any, Callable, Dict, Hashable, Optional, Sequence, Tuple, Union, cast
  from ..config import registry
  from ..model import Model
  from ..types import DTypes, Ints1d, Ints2d
  from ..util import is_xp_array, to_numpy
label_desc: Use image node_id 4 for calling a global function with example usage: forward_v2(model, inputs, is_train) and returns: output,  backprop, model, list