code: def test_dtype_check(self):
      padder = NumpyTensorPadder(
          pad_val=-1,
          ele_dtype=np.zeros(3, dtype=np.int8).dtype,
          dtype=int,
      )
      with pytest.raises(DtypeError):
          padder = NumpyTensorPadder(
              pad_val=-1, ele_dtype=str, dtype=int
          )
      if _NEED_IMPORT_TORCH:
          import torch
  
          with pytest.raises(DtypeError):
              padder = NumpyTensorPadder(
                  pad_val=-1, ele_dtype=torch.long, dtype=int
              )
          with pytest.raises(DtypeError):
              padder = NumpyTensorPadder(
                  pad_val=-1, ele_dtype=int, dtype=torch.long
              )
  
file_path: fastNLP/tests/core/collators/padders/test_numpy_padder.py
imports: import numpy
  import pytest
  from fastNLP.core.collators.padders.numpy_padder import NumpyTensorPadder, NumpySequencePadder, NumpyNumberPadder
  from fastNLP.core.collators.padders.exceptions import DtypeError
  from fastNLP.envs.imports import _NEED_IMPORT_TORCH
label_desc: Use image node_id 2 for calling the TestNumpyTensorPadder obj's underlying member method code with example usage: obj.test_dtype_check() without return types