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_paddle_tensor(ele_dtype)
          or is_paddle_dtype_str(ele_dtype)
      ):
          raise EleDtypeUnsupportedError(
              f"`{class_name}` only supports padding python numbers "
              f"or numpy numbers or paddle.Tensor but get `{ele_dtype}`."
          )
  
      if dtype is not None:
          if not (
              is_paddle_tensor(dtype)
              or is_number(dtype)
              or is_paddle_dtype_str(dtype)
          ):
              raise DtypeUnsupportedError(
                  f"The dtype of `{class_name}` only supports python numbers "
                  f"or paddle.dtype but get `{dtype}`."
              )
          dtype = number_to_paddle_dtype_dict.get(dtype, dtype)
      else:
          if is_number(ele_dtype) or is_paddle_tensor(ele_dtype):
              ele_dtype = number_to_paddle_dtype_dict.get(
                  ele_dtype, ele_dtype
              )
              dtype = ele_dtype
          elif is_numpy_number_dtype(ele_dtype):  # 存在一个转换的问题了
              dtype = numpy_to_paddle_dtype_dict.get(ele_dtype.type)
          elif is_numpy_generic_class(ele_dtype):
              dtype = numpy_to_paddle_dtype_dict.get(ele_dtype)
          else:
              dtype = ele_dtype
  
      return dtype
  
imports: from inspect import isclass
  import numpy
  from fastNLP.envs.imports import _NEED_IMPORT_PADDLE
  from .padder import Padder
  from .utils import is_number_or_numpy_number, is_number, is_numpy_number_dtype, is_numpy_generic_class, get_padded_numpy_array
  from .exceptions import *
label_desc: Use image node_id 3 for calling a global function with example usage: _get_dtype(ele_dtype, dtype, class_name) and returns: dtype