Skip to content

Commit

Permalink
Support Tuple observation spaces (openai#911)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshim5 authored and pzhokhov committed May 31, 2019
1 parent 9b68103 commit 21776e8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions baselines/common/vec_env/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down

0 comments on commit 21776e8

Please sign in to comment.