-
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
Inferring Box scalar shape #2911
Conversation
… to fix bug if environment doesn't use np_random in reset
…n the opposite case than was intended to (openai#2871)" This reverts commit 519dfd9.
Overall I like the idea, but are you sure we want the default shape to be The difference is somewhat subtle, but the main issue I'm finding now is that with zero-dimensional arrays, you can't concatenate them. You can stack them, the output being different (though just by a single empty dimension) Zero-dim arrays have this weird status kinda between being just a number and being a proper array (even though the type is |
(also, whatever the decision will be - tests) |
I think you are right on the shape being |
Looks good now |
This PR adds several changes to box
low
andhigh
are instances ofnp.ndarray
instead ofnp.isscalar
as this function has a number of weird cases that we don't want, e.g. stringsnp.issubdtype(type(dim), np.integer))
that should allow a tuple ofnp.int64
. However added conversion after that the shape is a tuple of integers. This is a partial change, however, reflects the expected type ofshape
and don't expect this to affect someone.low
andhigh
through checking if the type oflow
andhigh
are sub dtypes ofnp.integer
ornp.floating
.low
andhigh
for scalars to removeisscalar
due to the problems noted above.