code: def test_get_padder_run(backend):
      if not _NEED_IMPORT_TORCH and backend == "torch":
          pytest.skip("No torch")
      if not _NEED_IMPORT_PADDLE and backend == "paddle":
          pytest.skip("No paddle")
      if not _NEED_IMPORT_JITTOR and backend == "jittor":
          pytest.skip("No jittor")
      if not _NEED_IMPORT_ONEFLOW and backend == "oneflow":
          pytest.skip("No oneflow")
      batch_field = [1, 2, 3]
      padder = get_padder(
          batch_field,
          pad_val=0,
          backend=backend,
          dtype=int,
          field_name="test",
      )
  
      if backend is not None:
          # 不能 pad
          batch_field = [[1], [2, 3], [3], 2]
          with pytest.raises(InconsistencyError):
              padder = get_padder(
                  batch_field,
                  pad_val=0,
                  backend=backend,
                  dtype=int,
                  field_name="test",
              )
          padder = get_padder(
              batch_field,
              pad_val=None,
              backend=backend,
              dtype=int,
              field_name="test",
          )
  
          # 不能 pad
          batch_field = [["2"], ["2"], ["2", "2"]]
          with pytest.raises(DtypeError) as exec_info:
              padder = get_padder(
                  batch_field,
                  pad_val=0,
                  backend=backend,
                  dtype=int,
                  field_name="test",
              )
          padder = get_padder(
              batch_field,
              pad_val=None,
              backend=backend,
              dtype=int,
              field_name="test",
          )
  
          batch_field = [np.zeros(3), np.zeros((3, 1))]
          with pytest.raises(InconsistencyError) as exec_info:
              padder = get_padder(
                  batch_field,
                  pad_val=0,
                  backend=backend,
                  dtype=int,
                  field_name="test",
              )
          padder = get_padder(
              batch_field,
              pad_val=None,
              backend=backend,
              dtype=int,
              field_name="test",
          )  # no pad
  
          batch_field = [np.zeros((3, 1)), np.zeros((4, 1))]
          padder = get_padder(
              batch_field,
              pad_val=0,
              backend=backend,
              dtype=int,
              field_name="test",
          )
  
file_path: fastNLP/tests/core/collators/padders/test_get_padder.py
imports: import pytest
  import numpy
  from fastNLP.core.collators.padders.get_padder import get_padder, InconsistencyError, DtypeError, _get_element_shape_dtype
  from fastNLP.envs.imports import _NEED_IMPORT_TORCH, _NEED_IMPORT_PADDLE, _NEED_IMPORT_JITTOR, _NEED_IMPORT_ONEFLOW
label_desc: Use image node_id 2 for calling a global function with example usage: test_get_padder_run(backend) without return types