unienv_interface.space.spaces.text¶
Implementation of a space that represents the cartesian product of Discrete spaces.
alphanumeric
module-attribute
¶
alphanumeric: FrozenSet[str] = frozenset('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')
TextSpace
¶
TextSpace(backend: ComputeBackend[Any, BDeviceType, BDtypeType, BRNGType], max_length: int, *, min_length: int = 0, charset: Optional[FrozenSet[str] | str] = None, device: Optional[BDeviceType] = None)
Bases: Space[str, BDeviceType, BDtypeType, BRNGType]
shape
property
¶
shape: tuple[int, ...] | None
Return the shape of the space as an immutable property.
get_repr
¶
get_repr(abbreviate=False, include_backend=True, include_device=True, include_dtype=True)
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.