code: def forward(model, X, is_train):
      index = model.attrs["index"]
      shape = X.shape
      dtype = X.dtype
  
      def backprop_get_column(dY):
          dX = model.ops.alloc(shape, dtype=dtype)
          dX[index] = dY
          return dX
  
      if len(X) == 0:
          return X, backprop_get_column
      Y = X[index]
      return Y, backprop_get_column
  
imports: from typing import Sequence, Tuple, TypeVar, Union
  from ..model import Model
  from ..types import ArrayXd, FloatsXd, IntsXd
label_desc: Use image node_id 4 for calling a global function with example usage: forward(model, X, is_train) and returns: Y,  backprop_get_column, dX, X,  backprop_get_column