class_docstr: Pad the input ndarrays along the specific padding axis and stack them to get the output.
  Input of the function will be N samples. Each sample should contain a single element that
  can be 1) numpy.ndarray, 2) th.Tensor, 3) list of numbers.
  You can set the `pad_val` to determine the padding value.
  In addition, you can specify the
  The arrays will be padded to the largest dimensions(at most 5 dimensions to pad) and then
  stacked to form the final output.
  
  Parameters
  ----------
  val : float or int, default None
      The padding value.
  axis : int
      The dimension to insert the batch axis.
  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
  --------
  >>> from codel.data import batchify
  >>> # Inputs are multiple lists
  >>> a = [1, 2, 3, 4]
  >>> b = [4, 5, 6]
  >>> c = [8, 2]
  >>> batchify.Pad()([a, b, c])
  [[ 1  2  3  4]
   [ 4  5  6  0]
   [ 8  2  0  0]]
  <NDArray 3x4 @cpu(0)>
  >>> # Also output the lengths
  >>> a = [1, 2, 3, 4]
  >>> b = [4, 5, 6]
  >>> c = [8, 2]
  >>> # Inputs are multiple ndarrays
  >>> import numpy as np
  >>> a = np.array([[1, 2, 3, 4], [5, 6, 7, 8]])
  >>> b = np.array([[5, 8], [1, 2]])
  >>> batchify.Pad(val=-1)([a, b])
  [[[ 1  2  3  4]
    [ 5  6  7  8]]
   [[ 5  8 -1 -1]
    [ 1  2 -1 -1]]]
  <NDArray 2x2x4 @cpu(0)>
  >>> # Inputs are multiple NDArrays
  >>> import torch as th
  >>> a = th.tensor([[1, 2, 3, 4], [5, 6, 7, 8]])
  >>> b = th.tensor([[5, 8], [1, 2]])
  >>> batchify.Pad(val=-1)([a, b])
  [[[ 1.  2.  3.  4.]
    [ 5.  6.  7.  8.]]
   [[ 5.  8. -1. -1.]
    [ 1.  2. -1. -1.]]]
  <NDArray 2x2x4 @cpu(0)>
code: def __init__(self, val=None, axis=0, dtype=None, round_to=None):
      self._pad_val = 0 if val is None else val
      self._dtype = to_torch_dtype(dtype)
      self._axis = axis
      self._round_to = round_to
  
imports: import math
  from typing import AnyStr
  from typing import Callable
  from typing import Dict
  from typing import List
  from typing import NamedTuple
  from typing import Tuple
  from typing import Union
  import numpy
  import torch
  from ..utils import to_torch_dtype
label_desc: Use image node_id 1 to create a new Pad object  with example: obj = Pad(val, axis, dtype, round_to)