tinyspace#
tinyspace#
Dataclass#
- class tinyspace.TinySpace(shape, dtype, low, high, cls=None, desc=None)[source]#
A simple and lightweight spaces implementation for RL environments, in place of gym.spaces.
Any Space is a
TinySpacewith the following args or adictwhere each value is aTinySpace.You can either use this dataclass or just define a Space using dicts, since tinyspace prefers subscriptable access. However, because a
TinySpaceis a dataclass, dot access also works.
Typing#
- tinyspace.Space#
alias of
Union[tinyspace.TinySpace,Mapping[str,tinyspace.TinySpace]]
Creating#
Using#
- tinyspace.is_ndshape(space)[source]#
Checks if space.shape is “nd”, meaning atleast one dimension has variable length.
- tinyspace.sample_from_space(space, zeros=True, batch_size=1, ndim_pad=1, to_torch_tensor=False)[source]#