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)>
docstr: Batchify the input data.
  
  The input can be list of numpy.ndarray, list of numbers or list of
  th.Tensor. The arrays will be padded to the largest dimension at `axis` and then
  stacked to form the final output.
  
  Parameters
  ----------
  data : List[np.ndarray] or List[List[dtype]] or List[th.Tensor]
      List of samples to pad and stack.
  
  Returns
  -------
  batch_data: th.Tensor
      Data in the minibatch.
      If batch_dim = 0:
          Shape (N, ...)
      Otherwise, the N will be inserted to the location of the batch_dim, which will be
          Shape (..., N, ...)
docstr_tok: ["Batchify","the","input","data",".","The","input","can","be","list","of","numpy.ndarray",",","list","of","numbers","or","list","of","th.Tensor",".","The","arrays","will","be","padded","to","the","largest","dimension","at","`","axis","`","and","then","stacked","to","form","the","final","output",".","Parameters","--","--","--","--","--","data",":","List","[","np.ndarray","]","or","List","[","List","[","dtype","]","]","or","List","[","th.Tensor","]","List","of","samples","to","pad","and","stack",".","Returns","--","--","--","-","batch_data",":","th.Tensor","Data","in","the","minibatch",".","If","batch_dim","=","0",":","Shape","(","N",",","...",")","Otherwise",",","the","N","will","be","inserted","to","the","location","of","the","batch_dim",",","which","will","be","Shape","(","...",",","N",",","...",")"]
code: def __call__(self, data):
      """Batchify the input data.
  
      The input can be list of numpy.ndarray, list of numbers or list of
      th.Tensor. The arrays will be padded to the largest dimension at `axis` and then
      stacked to form the final output.
  
      Parameters
      ----------
      data : List[np.ndarray] or List[List[dtype]] or List[th.Tensor]
          List of samples to pad and stack.
  
      Returns
      -------
      batch_data: th.Tensor
          Data in the minibatch.
          If batch_dim = 0:
              Shape (N, ...)
          Otherwise, the N will be inserted to the location of the batch_dim, which will be
              Shape (..., N, ...)
      """
      _arr_cls = th.Tensor
      if isinstance(data[0], (_arr_cls, np.ndarray, list)):
          padded_arr = _pad_arrs_to_max_length(
              data,
              pad_val=self._pad_val,
              dtype=self._dtype,
              batch_dim=self._axis,
              round_to=self._round_to,
          )
          return padded_arr
      else:
          raise NotImplementedError(
              "Pad() does not support multiple items, use Group(Pad(), Pad(), ...) instead"
          )
  
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 2 for calling the Pad obj's underlying member method code with example usage: obj.__call__(data) and returns: padded_arr