Why JIT results in a wrong value? #8397
-
I am trying to run a simple square function using |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Can you give more details? What exactly did you run to get both outputs? |
Beta Was this translation helpful? Give feedback.
-
See: https://jax.readthedocs.io/en/latest/notebooks/Common_Gotchas_in_JAX.html#double-64bit-precision JAX enforces 32-bit calculations by default, and the different output comes from performing the calculation in 32-bit precision. You would receive the same output from a NumPy float32 from
|
Beta Was this translation helpful? Give feedback.
See: https://jax.readthedocs.io/en/latest/notebooks/Common_Gotchas_in_JAX.html#double-64bit-precision
JAX enforces 32-bit calculations by default, and the different output comes from performing the calculation in 32-bit precision.
You would receive the same output from a NumPy float32 from
Sq
if you instead set: