-
Is there a way to disable/suppress JAX's warning:
? The following works but it also filters out all absl warnings...
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You can set the JAX platform to 'cpu', with one of these approaches:
Here's an example: import jax
import jax.numpy as jnp
jax.config.update('jax_platform_name', 'cpu')
jnp.sin(0.)
The reason the warning prints is that by default JAX tries to use a hardware accelerator, rather than defaulting to CPU. If you set the platform to CPU, it won't try to find a hardware accelerator, and so it won't warn you that it couldn't find one. |
Beta Was this translation helpful? Give feedback.
-
@mattjj Thanks! So fast :) |
Beta Was this translation helpful? Give feedback.
You can set the JAX platform to 'cpu', with one of these approaches:
JAX_PLATFORM_NAME=cpu
environment variable;jax.config.update('jax_platform_name', 'cpu')
at the top of your main file;absl
and pass the argument--jax_platform_name=cpu
.Here's an example:
The reason the warning prints is that by default JAX tries to use a hardware accelerator, rather than defaulting to CPU. If you set the platform to CPU, it won't try to find a hardware accelerator, and so it won't warn you that it couldn't find one.