code: def tsn_mp_batchify_fn(data):
      """Collate data into batch. Use shared memory for stacking.
      Modify default batchify function for temporal segment networks.
      Change `nd.stack` to `nd.concat` since batch dimension already exists.
      """
      if isinstance(data[0], nd.NDArray):
          return nd.concat(*data, dim=0)
      elif isinstance(data[0], tuple):
          data = zip(*data)
          return [tsn_mp_batchify_fn(i) for i in data]
      else:
          data = np.asarray(data)
          return nd.array(
              data,
              dtype=data.dtype,
              ctx=context.Context("cpu_shared", 0),
          )
  
imports: import io
  import pickle
  import multiprocessing
  from multiprocessing.reduction import ForkingPickler
  import numpy
  from mxnet import nd
  from mxnet import context
  from mxnet.gluon.data.dataloader import DataLoader, _MultiWorkerIter
  from mxnet.gluon.data.dataloader import default_mp_batchify_fn, default_batchify_fn
label_desc: Use image node_id 3 for calling a global function with example usage: tsn_mp_batchify_fn(data) and returns: nd, unknown, nd