mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-08-01 06:07:08 +00:00
Flatten space docstring note about unflattening samples (#164)
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user