-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix random seed int32 for Windows #1655
Conversation
Hmm, does an explicit cast |
I would suggest a small improvement to eliminate the magic number. 2**32 - 1 == np.iinfo(np.uint32).max == 4294967295
The issue lies not with Windows, but with NumPy. It uses different implicit types for Windows and Linux. On Windows, it's a signed 32-bit integer, while on Linux, it's a 64-bit integer. By explicitly setting the type, everything should function correctly. On Windows https://docs.scipy.org/doc/numpy-1.10.1/user/basics.types.html |
@PatrickHelm could you test @MikhailGerasimov solution on windows? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks =)
|
Description
I recognized the error described in #1579 while running the tests for another pull request on Windows. To fix it, I changed
high
innp.random.randint
from2**32-1
to2**31-1.
The solution proposed by @MikhailGerasimov in #1579 did not work as Gymnasium does not accept numpy integers as seeds.Motivation and Context
closes #1579
Types of changes
Checklist
make format
(required)make check-codestyle
andmake lint
(required)make pytest
andmake type
both pass. (required)make doc
(required)Note: You can run most of the checks using
make commit-checks
.Note: we are using a maximum length of 127 characters per line