mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-08-30 01:50:19 +00:00
Allow sequence to accept stacked np arrays if the feature space is Box (#241)
This commit is contained in:
@@ -119,7 +119,8 @@ class Sequence(Space[typing.Tuple[Any, ...]]):
|
||||
|
||||
def contains(self, x: Any) -> bool:
|
||||
"""Return boolean specifying if x is a valid member of this space."""
|
||||
return isinstance(x, collections.abc.Sequence) and all(
|
||||
# by definition, any sequence is an iterable
|
||||
return isinstance(x, collections.abc.Iterable) and all(
|
||||
self.feature_space.contains(item) for item in x
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user