code: def default_mp_pad_batchify_fn(data):
      """Use shared memory for collating data into batch, labels are padded to same shape"""
      if isinstance(data[0], nd.NDArray):
          out = nd.empty(
              (len(data),) + data[0].shape,
              dtype=data[0].dtype,
              ctx=context.Context("cpu_shared", 0),
          )
          return nd.stack(*data, out=out)
      elif isinstance(data[0], tuple):
          data = zip(*data)
          return [default_mp_pad_batchify_fn(i) for i in data]
      else:
          data = np.asarray(data)
          batch_size = len(data)
          pad = max(
              [l.shape[0] for l in data]
              + [
                  1,
              ]
          )
          buf = np.full(
              (batch_size, pad, data[0].shape[-1]),
              -1,
              dtype=data[0].dtype,
          )
          for i, l in enumerate(data):
              buf[i][: l.shape[0], :] = l
          return nd.array(
              buf,
              dtype=data[0].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 2 for calling a global function with example usage: default_mp_pad_batchify_fn(data) and returns: nd, unknown, nd