code: def get_padded_paddle_tensor(batch_field, dtype=None, pad_val=0):
      """
      例如:
          [[1,2], [3]] -> paddle.LongTensor([[1, 2], [3, 0]])
  
      :param batch_field: 需要 pad 的对象。需要保证应该是可以进行 pad 的。支持 1d（多为句子长度）/2d（多为文本序列）/3d（多为字符序列）
          /4d（多为图片）。
      :param dtype: 目标类别是什么
      :param pad_val: pad 的 value
      :return:
      """
      array = get_padded_numpy_array(
          batch_field=batch_field, dtype=None, pad_val=pad_val
      )
      tensor = paddle.to_tensor(array, dtype=dtype)
      return tensor
  
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 4 for calling a global function with example usage: get_padded_paddle_tensor(batch_field, dtype, pad_val) and returns: tensor