Support Tuple observation spaces (#911)

This commit is contained in:
Joshua Meier
2019-05-31 17:06:20 -04:00
committed by pzhokhov
parent 9b68103b73
commit 21776e8f57

View File

@@ -38,6 +38,9 @@ def obs_space_info(obs_space):
if isinstance(obs_space, gym.spaces.Dict):
assert isinstance(obs_space.spaces, OrderedDict)
subspaces = obs_space.spaces
elif isinstance(obs_space, gym.spaces.Tuple):
assert isinstance(obs_space.spaces, tuple)
subspaces = {i: obs_space.spaces[i] for i in range(len(obs_space.spaces))}
else:
subspaces = {None: obs_space}
keys = []