code: def fill_tensor(batch_field, padded_batch, dtype):
      """
      将 batch_field 中的值填入到 tensor 中。
  
      :param batch_field: 需要填充进入 array 中的内容
      :param padded_batch: 待填充的 tensor
      :param dtype: 数据的类别
  
      :return:
      """
      if padded_batch.ndim == 2:
          for i, content_i in enumerate(batch_field):
              padded_batch[i, : len(content_i)] = jittor.Var(
                  np.array(content_i, dtype=dtype)
              )
      elif padded_batch.ndim == 3:
          for i, content_i in enumerate(batch_field):
              for j, content_ii in enumerate(content_i):
                  padded_batch[i, j, : len(content_ii)] = jittor.Var(
                      np.array(content_ii, dtype=dtype)
                  )
      elif padded_batch.ndim == 4:
          try:  # 应该是图像，所以直接应该就 ok 了。
              padded_batch = jittor.Var(batch_field)
          except:
              for i, content_i in enumerate(batch_field):
                  for j, content_ii in enumerate(content_i):
                      for k, content_iii in enumerate(content_ii):
                          padded_batch[
                              i, j, k, : len(content_iii)
                          ] = jittor.Var(
                              np.array(content_iii, dtype=dtype)
                          )
      elif padded_batch.ndim == 1:
          padded_batch[:] = jittor.Var(
              np.array(batch_field, dtype=dtype)
          )
      else:
          raise RuntimeError(
              "fastNLP does not support padding for more than 3 dimensions. If you need this, please "
              "report."
          )
      return padded_batch
  
imports: from inspect import isclass
  import numpy
  from fastNLP.envs.imports import _NEED_IMPORT_JITTOR
  from .padder import Padder
  from .utils import is_number_or_numpy_number, is_number, is_numpy_number_dtype, get_shape, is_numpy_generic_class
  from .exceptions import *
label_desc: Use image node_id 4 for calling a global function with example usage: fill_tensor(batch_field, padded_batch, dtype) and returns: padded_batch