code: def pad(tensors, padding_value=0, total_length=None):
      size = [len(tensors)] + [
          max(tensor.size(i) for tensor in tensors)
          for i in range(len(tensors[0].size()))
      ]
      if total_length is not None:
          assert total_length >= size[1]
          size[1] = total_length
      out_tensor = tensors[0].data.new(*size).fill_(padding_value)
      for i, tensor in enumerate(tensors):
          out_tensor[i][[slice(0, i) for i in tensor.size()]] = tensor
      return out_tensor
  
file_path: underthesea/underthesea/utils/sp_fn.py
imports: import unicodedata
label_desc: Use image node_id 7 for calling a global function with example usage: pad(tensors, padding_value, total_length) and returns: out_tensor