Flatten space docstring note about unflattening samples (#164)

This commit is contained in:
Ephraim
2022-11-28 14:17:49 -08:00
committed by GitHub
parent a1759685e0
commit df811e7d54

View File

@@ -367,8 +367,11 @@ def flatten_space(space: Space[Any]) -> Box | Dict | Sequence | Tuple | Graph:
the result for graph spaces is always a `Graph` with `node_space` being a `Box`
with flat boundaries and `edge_space` being a `Box` with flat boundaries or
`None`. The box has exactly :func:`flatdim` dimensions. Flattening a sample
of the original space has the same effect as taking a sample of the flattenend
space.
of the original space has the same effect as taking a sample of the flattened
space. However, sampling from the flattened space is not necessarily reversible.
For example, sampling from a flattened Discrete space is the same as sampling from
a Box, and the results may not be integers or one-hot encodings. This may result in
errors or non-uniform sampling.
Example::
>>> from gymnasium.spaces import Box