class_docstr: Return a callable that pads and stacks data.
  
  Parameters
  ----------
  val : float or int, default 0
      The padding value.
  axis : int, default 0
      The axis to pad the arrays. The arrays will be padded to the largest dimension at
      `axis`. For example, assume the input arrays have shape
      (10, 8, 5), (6, 8, 5), (3, 8, 5) and the `axis` is 0. Each input will be padded into
      (10, 8, 5) and then stacked to form the final output, which has shape（3, 10, 8, 5).
  dtype : str or numpy.dtype, default None
      The value type of the output. If it is set to None, the input data type is used.
  round_to : int, default None
      If specified, the padded dimension will be rounded to be multiple of this argument.
  
  Examples
  --------
  >>> import gluonnlp.batchify as bf
  >>> # Inputs are multiple lists
  >>> a = [1, 2, 3, 4]
  >>> b = [4, 5, 6]
  >>> c = [8, 2]
  >>> bf.Pad()([a, b, c])
  <BLANKLINE>
  [[1. 2. 3. 4.]
   [4. 5. 6. 0.]
   [8. 2. 0. 0.]]
  <NDArray 3x4 @cpu_shared(0)>
  >>> # Inputs are multiple numpy ndarrays
  >>> a = np.array([[1, 2, 3, 4], [5, 6, 7, 8]])
  >>> b = np.array([[5, 8], [1, 2]])
  >>> bf.Pad(axis=1, val=-1)([a, b])
  <BLANKLINE>
  [[[ 1  2  3  4]
    [ 5  6  7  8]]
  <BLANKLINE>
   [[ 5  8 -1 -1]
    [ 1  2 -1 -1]]]
  <NDArray 2x2x4 @cpu_shared(0)>
docstr: Batchify the input data.
  
  The input can be list of numpy.ndarray, list of numbers or list of
  mxnet.nd.NDArray. Inputting mxnet.nd.NDArray is discouraged as each
  array need to be converted to numpy for efficient padding.
  
  The arrays will be padded to the largest dimension at `axis` and then
  stacked to form the final output. In addition, the function will output
  the original dimensions at the `axis` if ret_length is turned on.
  
  Parameters
  ----------
  data : List[np.ndarray] or List[List[dtype]] or List[mx.nd.NDArray]
      List of samples to pad and stack.
  
  Returns
  -------
  batch_data: NDArray
      Data in the minibatch. Shape is (N, ...)
docstr_tok: ["Batchify","the","input","data",".","The","input","can","be","list","of","numpy.ndarray",",","list","of","numbers","or","list","of","mxnet.nd.NDArray",".","Inputting","mxnet.nd.NDArray","is","discouraged","as","each","array","need","to","be","converted","to","numpy","for","efficient","padding",".","The","arrays","will","be","padded","to","the","largest","dimension","at","`","axis","`","and","then","stacked","to","form","the","final","output",".","In","addition",",","the","function","will","output","the","original","dimensions","at","the","`","axis","`","if","ret_length","is","turned","on",".","Parameters","--","--","--","--","--","data",":","List","[","np.ndarray","]","or","List","[","List","[","dtype","]","]","or","List","[","mx.nd.NDArray","]","List","of","samples","to","pad","and","stack",".","Returns","--","--","--","-","batch_data",":","NDArray","Data","in","the","minibatch",".","Shape","is","(","N",",","...",")"]
code: def __call__(self, data):
      """Batchify the input data.
  
      The input can be list of numpy.ndarray, list of numbers or list of
      mxnet.nd.NDArray. Inputting mxnet.nd.NDArray is discouraged as each
      array need to be converted to numpy for efficient padding.
  
      The arrays will be padded to the largest dimension at `axis` and then
      stacked to form the final output. In addition, the function will output
      the original dimensions at the `axis` if ret_length is turned on.
  
      Parameters
      ----------
      data : List[np.ndarray] or List[List[dtype]] or List[mx.nd.NDArray]
          List of samples to pad and stack.
  
      Returns
      -------
      batch_data: NDArray
          Data in the minibatch. Shape is (N, ...)
  
      """
  
      if isinstance(data[0], mx.nd.NDArray) and not self._warned:
          self._warned = True
          # TODO(sxjscience) Investigate the warning
          warnings.warn(
              "Using Pad with NDArrays is discouraged for speed reasons. "
              "Instead you should pad your data while it is still a list "
              "and before converting to an NDArray. "
              "Alternatively you can consider inputting a numpy.ndarray."
          )
      if isinstance(data[0], (mx.nd.NDArray, np.ndarray, list)):
          padded_arr = _pad_arrs_to_max_length(
              data,
              self._axis,
              self._val,
              False,
              self._dtype,
              round_to=self._round_to,
          )
          return padded_arr
      else:
          raise NotImplementedError
  
imports: import warnings
  import math
  from typing import Dict, Callable, NamedTuple, List, Tuple, AnyStr, Union
  import numpy
  import mxnet
  from mxnet.util import is_np_array
label_desc: Use image node_id 2 for calling the Pad obj's underlying member method code with example usage: obj.__call__(data) and returns: padded_arr