code: def stack_tensor_dict_list(tensor_dict_list):
      """Stack a list of dictionaries of {tensors or dictionary of tensors}.
  
      Args:
          tensor_dict_list (dict): a list of dictionaries of {tensors or
              dictionary of tensors}.
  
      Returns:
          dict: a dictionary of {stacked tensors or dictionary of stacked
              tensors}.
      """
      keys = list(tensor_dict_list[0].keys())
      ret = dict()
      for k in keys:
          example = tensor_dict_list[0][k]
  
          if isinstance(example, dict):
              v = stack_tensor_dict_list(
                  [x[k] for x in tensor_dict_list]
              )
          else:
              v = np.array([x[k] for x in tensor_dict_list])
  
          ret[k] = v
  
      return ret
  
imports: import collections
  import numpy
  import tensorflow
label_desc: Use image node_id 14 for calling a global function with example usage: stack_tensor_dict_list(tensor_dict_list) and returns: ret