-
Notifications
You must be signed in to change notification settings - Fork 8.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tuple
__eq__ fails when spaces
aren't of the same type
#2140
Labels
Comments
Tuple
constructur doesn't convert spaces
arg to tuple, causing __eq__ to failTuple
constructor doesn't convert spaces
arg to tuple, causing __eq__ to fail
Tuple
constructor doesn't convert spaces
arg to tuple, causing __eq__ to failTuple
__eq__ fails when spaces
aren't of the same type
lebrice
added a commit
to lebrice/gym
that referenced
this issue
Dec 28, 2020
Fixes openai#2140 Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
Hi, I also use spaces.Tuple as my observation space, which algorithm do you use? I want to use dqn, and it seems that dqn requires env.ovservation_space.shape, but Tuple doesn't have the shape method. I was wondering, how do you combine Tuple with your algorithm? thanks in advance! |
@lebrice should this issue still be open? |
Hey @jkterry1 I'll check if it's still reproducible and I'll get back to you. |
This was referenced Nov 17, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When creating a
gym.spaces.Tuple
, if a list of spaces is passed as thespaces
argument, I believe it should be converted to a tuple, as otherwise the space could be modified, which doesn't seem like an intended behaviour, and comparisons with other equivalentspaces.Tuple
objects, but created with tuple arguments, will fail:The way I see it, this can be easily fixed in one of two ways:
Convert the
spaces
argument to a tuple in the constructor:However this might change the behaviour of some programs which depend on being able to modify
Tuple
spaces.Convert the
spaces
argument to a tuple just when comparing:This won't copy anything if
self.spaces
is already a tuple, however for lists its a small copy.Let me know what you think!
The text was updated successfully, but these errors were encountered: