code: def _get_element_shape_dtype(
      content, parent=None, catalog=None
  ) -> Dict:
      """
      获取对象的中 element 的基本信息，用于判断是否可以 padding。
  
      :param content:
      :param tuple parent:
      :param dict catalog: 记录元素信息的 dict。其中的 index 记录的是每一个元素的 拓扑 结构。
          例如: [1, 2, 3] -> {(0,): ((), <class 'int'>), (1,): ((), <class 'int'>), (2,): ((), <class 'int'>)}
          例如: [1, [2, 3], 4] -> {(0,): ((), <class 'int'>), (1, 0): ((), <class 'int'>), (1, 1): ((), <class 'int'>), (2,): ((), <class 'int'>)}
          例如: [[1, 2], [3], [4, 5]] -> {(0, 0): ((), <class 'int'>), (0, 1): ((), <class 'int'>), (1, 0): ((), <class 'int'>), (2, 0): ((), <class 'int'>), (2, 1): ((), <class 'int'>)}
          例如: [torch.ones(3, 4), torch.ones(3, 4), torch.ones(3, 4)]
              -> {(0,): (torch.Size([3, 4]), torch.float32), (1,): (torch.Size([3, 4]), torch.float32), (2,): (torch.Size([3, 4]), torch.float32)}
  
      :return:
      """
      if catalog is None:
          catalog = {}
  
      if parent is None:
          parent = ()
  
      if isinstance(content, HasShapeDtype):  # 各类 tensor 或者 np.ndarray
          shape = content.shape
          dtype = content.dtype
          catalog[parent] = (shape, dtype)
      elif isinstance(content, (tuple, list)):
          for i, c in enumerate(content):
              _get_element_shape_dtype(
                  c, parent=parent + (i,), catalog=catalog
              )
      else:  # 包括 int/float/bool/dict 以及 其它无法pad 的等
          catalog[parent] = (
              (),
              type(content),
          )  # () 表示 shape 的长度为 0，后面表示其类别
      return catalog
  
file_path: fastNLP/fastNLP/core/collators/padders/get_padder.py
imports: from typing import Sequence, Any, Union, Dict
  from abc import ABC
  from fastNLP.core.log import logger
  from .padder import Padder, NullPadder
  from .numpy_padder import NumpyNumberPadder, NumpySequencePadder, NumpyTensorPadder
  from .torch_padder import TorchNumberPadder, TorchSequencePadder, TorchTensorPadder
  from .raw_padder import RawNumberPadder, RawSequencePadder, RawTensorPadder
  from .paddle_padder import PaddleTensorPadder, PaddleSequencePadder, PaddleNumberPadder
  from .jittor_padder import JittorTensorPadder, JittorSequencePadder, JittorNumberPadder
  from .oneflow_padder import OneflowTensorPadder, OneflowSequencePadder, OneflowNumberPadder
  from .exceptions import *
label_desc: Use image node_id 2 for calling a global function with example usage: _get_element_shape_dtype(content, parent, catalog) and returns: catalog