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

On the use of jnp.int_ #58

Open
kngwyu opened this issue Jun 12, 2023 · 1 comment
Open

On the use of jnp.int_ #58

kngwyu opened this issue Jun 12, 2023 · 1 comment

Comments

@kngwyu
Copy link

kngwyu commented Jun 12, 2023

Hi, thank you for your work on this great library. When I tried gymnax for the first time, I frequently encountered errors due to the use of jnp.int_.

UserWarning: Explicitly requested dtype <class 'jax.numpy.int64'> requested in array is not available, and will be truncated to dtype int32. To enable more dtypes, set the jax_enable_x64 configuration option or the JAX_ENABLE_X64 shell environment variable. See https://github.com/google/jax#current-gotchas for more.

It looks like jnp.int_ is used in:

  • Catch-bsuite
  • Freeway-minatar
  • spaces.Discrete
  • spaces.contain

So my question is: do you have any specific reason to use jnp.int_? If not, I want to contribute to replacing these with jnp.int32 because I don't need JAX_ENABLE_X64 for other usages...

@keraJLi
Copy link
Contributor

keraJLi commented Jan 31, 2024

This issue should be fixed by making use of jax.dtypes.canonicalize_dtype. I'll submit a pull request when I get the time.

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

No branches or pull requests

2 participants