code: def _get_dtype(ele_dtype, dtype, class_name):
      """
      用于检测数据的 dtype 类型， 根据内部和外部数据判断。
  
      :param ele_dtype: 内部数据的类型
      :param dtype:  数据外部类型
      :param class_name: 类的名称
      """
      if not (
          ele_dtype is None
          or (
              is_number_or_numpy_number(ele_dtype)
              or is_torch_tensor(ele_dtype)
          )
      ):
          raise EleDtypeUnsupportedError(
              f"`{class_name}` only supports padding python numbers "
              f"or numpy numbers or torch.Tensor but get `{ele_dtype}`."
          )
  
      if dtype is not None:
          if not (is_torch_tensor(dtype) or is_number(dtype)):
              raise DtypeUnsupportedError(
                  f"The dtype of `{class_name}` only supports python numbers "
                  f"or torch.dtype but get `{dtype}`."
              )
          dtype = number_to_torch_dtype_dict.get(dtype, dtype)
      else:
          if ele_dtype is not None:
              if is_number(ele_dtype) or is_torch_tensor(ele_dtype):
                  ele_dtype = number_to_torch_dtype_dict.get(
                      ele_dtype, ele_dtype
                  )
                  dtype = ele_dtype
              elif is_numpy_number_dtype(ele_dtype):  # 存在一个转换的问题了
                  dtype = numpy_to_torch_dtype_dict.get(ele_dtype.type)
              elif is_numpy_generic_class(ele_dtype):
                  dtype = numpy_to_torch_dtype_dict.get(ele_dtype)
  
      return dtype
  
imports: from inspect import isclass
  import numpy
  from fastNLP.envs.imports import _NEED_IMPORT_TORCH
  from .padder import Padder
  from .utils import is_number_or_numpy_number, is_number, is_numpy_number_dtype, get_shape, is_numpy_generic_class
  from .exceptions import *
label_desc: Use image node_id 2 for calling a global function with example usage: _get_dtype(ele_dtype, dtype, class_name) and returns: dtype