flatten_spaces(spaces: Iterable[Dict[str, torch.Tensor]])¶
Merges an iterable of dictionary spaces (usually observations or actions from subsequent sub-steps) into a single dictionary containing all the items.
If one key is present in multiple elements, its value will be present only once in the resulting dictionary, and all values for such key will be checked for a match.
Iterable of dictionary spaces (usually observations or actions from subsequent sub-steps).
One flat dictionary, containing all keys and values form the elements of the iterable.