code: def test_run(self):
      padder = PaddleTensorPadder(
          ele_dtype=paddle.zeros((3,)).dtype,
          dtype=paddle.zeros((3,)).dtype,
          pad_val=-1,
      )
      a = [paddle.zeros((3,)), paddle.zeros((2,))]
      a = padder(a)
      shape = a.shape
      assert isinstance(a, paddle.Tensor)
      assert tuple(shape) == (2, 3)
      b = paddle.to_tensor([[0, 0, 0], [0, 0, -1]], dtype="int64")
      assert (a == b).sum().item() == shape[0] * shape[1]
  
      a = [
          paddle.zeros((3, 2)),
          paddle.zeros((2, 2)),
          paddle.zeros((1, 2)),
      ]
      a = padder(a)
      shape = a.shape
      assert isinstance(a, paddle.Tensor)
      assert tuple(shape) == (3, 3, 2)
      b = paddle.to_tensor(
          [
              [[0, 0], [0, 0], [0, 0]],
              [[0, 0], [0, 0], [-1, -1]],
              [[0, 0], [-1, -1], [-1, -1]],
          ],
          dtype="int64",
      )
      assert (a == b).sum().item() == shape[0] * shape[1] * shape[2]
  
      a = [
          paddle.zeros((3, 2)),
          paddle.zeros((2, 2)),
          paddle.zeros((1, 1)),
      ]
      a = padder(a)
      shape = a.shape
      assert isinstance(a, paddle.Tensor)
      assert tuple(shape) == (3, 3, 2)
      b = paddle.to_tensor(
          [
              [[0, 0], [0, 0], [0, 0]],
              [[0, 0], [0, 0], [-1, -1]],
              [[0, -1], [-1, -1], [-1, -1]],
          ]
      )
      assert (a == b).sum().item() == shape[0] * shape[1] * shape[2]
  
      padder = PaddleTensorPadder(
          ele_dtype=paddle.zeros((3,)).dtype,
          dtype=paddle.zeros((3,)).dtype,
          pad_val=-1,
      )
      a = [paddle.zeros((3, 2)), paddle.zeros((2, 2))]
      a = padder(a)
      shape = a.shape
      assert isinstance(a, paddle.Tensor)
      assert tuple(shape) == (2, 3, 2)
      b = paddle.to_tensor(
          [
              [[0, 0], [0, 0], [0, 0]],
              [[0, 0], [0, 0], [-1, -1]],
          ]
      )
      assert (a == b).sum().item() == shape[0] * shape[1] * shape[2]
  
      padder = PaddleTensorPadder(
          ele_dtype=paddle.zeros((3, 2)).dtype, dtype=None, pad_val=-1
      )
      a = [
          np.zeros((3, 2), dtype=np.float32),
          np.zeros((2, 2), dtype=np.float32),
      ]
      a = padder(a)
      shape = a.shape
      assert isinstance(a, paddle.Tensor)
      assert tuple(shape) == (2, 3, 2)
      b = paddle.to_tensor(
          [[[0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [-1, -1]]],
          dtype="float32",
      )
      assert (a == b).sum().item() == shape[0] * shape[1] * shape[2]
  
file_path: fastNLP/tests/core/collators/padders/test_paddle_padder.py
imports: import numpy
  import pytest
  from fastNLP.core.collators.padders.paddle_padder import PaddleTensorPadder, PaddleSequencePadder, PaddleNumberPadder
  from fastNLP.core.collators.padders.exceptions import DtypeError
  from fastNLP.envs.imports import _NEED_IMPORT_PADDLE
label_desc: Use image node_id 1 for calling the TestPaddleTensorPadder obj's underlying member method code with example usage: obj.test_run() without return types