stack_torch_dict_list¶
- class maze.train.utils.train_utils.stack_torch_dict_list(dict_list: List[Dict[str, torch.Tensor | numpy.ndarray]], dim: int = 0)¶
Stack list of dictionaries holding torch tensors as values.
Similar to
stack_numpy_dict_list(), but for tensors.- Parameters:
dict_list – A list of identical dictionaries to be stacked.
dim – The dimension in which to stack/concat the lists.
- Returns:
The list entries as a stacked dictionary.