code: def get_shape(batch_field: List, shape=None):
      """
      给定 field 返回这个 field pad 完成之后的 shape 。
      例如: [[1, 2, 3], [3]] -> [2, 3]
           [[[1], [2], [3, 4]], [[2, 3, 4]]] -> [2, 3, 3]
  
      :param batch_field: list，第 0 维一般为 batch 维度。
      :param shape: 无需传入。
      :return:
      """
      if shape is None:
          shape = []
      if isinstance(batch_field, Sequence):
          num_ele = len(batch_field)
          _shape = shape + [num_ele]
          try:
              shapes = []
              if isinstance(batch_field[0], Sequence):
                  for _field in batch_field:
                      shapes.append(get_shape(_field, _shape))
                  if len(shapes) == 1:
                      max_shape = shapes[0]
                  else:
                      max_shape = [max(_) for _ in zip(*shapes)]
  
                  return max_shape
          except IndexError:  # 空的shape
              pass
          return _shape  # 说明是一个空的 sequence
      else:
          return shape
  
file_path: fastNLP/fastNLP/core/collators/padders/utils.py
imports: from typing import Sequence, List
  import re
  from inspect import isclass
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: get_shape(batch_field, shape) and returns: _shape, shape, max_shape