unienv_interface.space.spaces.dict¶
Implementation of a space that represents the cartesian product of other spaces as a dictionary.
DictSpace
¶
DictSpace(backend: ComputeBackend[Any, BDeviceType, BDtypeType, BRNGType], spaces: Optional[Union[Dict[str, Space[Any, BDeviceType, BDtypeType, BRNGType]], Sequence[Tuple[str, Space[Any, BDeviceType, BDtypeType, BRNGType]]]]] = None, device: Optional[BDeviceType] = None)
Bases: Space[Dict[str, Any], BDeviceType, BDtypeType, BRNGType]
Cartesian product of named subspaces represented as a mapping.
Create a dictionary-valued space from named child spaces.
shape
property
¶
shape: tuple[int, ...] | None
Return the shape of the space as an immutable property.
to
¶
to(backend: Optional[ComputeBackend] = None, device: Optional[Union[BDeviceType, Any]] = None) -> Union[DictSpace[BDeviceType, BDtypeType, BRNGType], DictSpace]
get_repr
¶
get_repr(abbreviate: bool = False, include_backend: bool = True, include_device: bool = True, include_dtype: bool = True) -> str
abbr_device
staticmethod
¶
abbr_device(spaces: Iterable[Space[Any, _SpaceBDeviceT, _SpaceBDTypeT, _SpaceBDRNGT]]) -> Optional[_SpaceBDeviceT]
Return the shared device across spaces, or None if mixed/empty.