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[list]): a list of dictionaries of {tensors or
              dictionary of tensors}.
  
      Return:
          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]
          dict_list = [x[k] if k in x else [] for x in tensor_dict_list]
          if isinstance(example, dict):
              v = stack_tensor_dict_list(dict_list)
          else:
              v = np.array(dict_list)
  
          ret[k] = v
  
      return ret
  
file_path: garage/src/garage/np/_functions.py
imports: import warnings
  import numpy
  import scipy.signal
label_desc: Use image node_id 10 for calling a global function with example usage: stack_tensor_dict_list(tensor_dict_list) and returns: ret