Add Sequence space, update flatten functions (#2968)

* Added Sequence space, updated flatten functions to work with Sequence, Graph. WIP.

* Small fixes, added Sequence space to tests

* Replace Optional[Any] by Any

* Added tests for flattening of non-numpy-flattenable spaces

* Return all seeds
This commit is contained in:
Markus Krimmel
2022-08-15 17:11:32 +02:00
committed by GitHub
parent 8b744130bc
commit 63ea5f2517
13 changed files with 613 additions and 58 deletions

View File

@@ -139,6 +139,11 @@ class Box(Space[np.ndarray]):
"""Has stricter type than gym.Space - never None."""
return self._shape
@property
def is_np_flattenable(self):
"""Checks whether this space can be flattened to a :class:`spaces.Box`."""
return True
def is_bounded(self, manner: str = "both") -> bool:
"""Checks whether the box is bounded in some sense.