Skip to content
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

Check np_random instance and use correct randint alternative #79

Merged
merged 1 commit into from Jun 22, 2022

Conversation

ishihara-y
Copy link
Contributor

@ishihara-y ishihara-y commented Jun 22, 2022

I am not sure when this change was made but in some environment, gym.unwrapped.np_random returns Generator instead of RandomState.

# in case of RandomState
# this line works
gym.unwrapped.np_random.rand_int(...)
# in case of Generator
# rand_int does not exist and we must use integers as an alternative
gym.unwrapped.np_random.integers(...)

This PR will fix this issue and chooses correct function for sampling integers.

@sbsekiguchi sbsekiguchi merged commit 39cdde7 into master Jun 22, 2022
@ishihara-y ishihara-y deleted the feature/20220609-support-np-rng branch July 28, 2022 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants