Using jax.numpy.complex128
in Jax reports an error, but jax.numpy.complex64
does not
#18222
Unanswered
zhaodazhuang
asked this question in
Q&A
Replies: 1 comment
-
Thanks for the question! This is expected behavior – unless you explicitly enable 64-bit computation, JAX will issue a warning and convert your 64-bit values to 32-bit values. For more, see JAX Sharp Bits: Double Precision. Try this instead: import jax
jax.config.update('jax_enable_x64', True)
import jax.numpy as jnp
n = 100
a = jnp.empty((n),dtype=float)
b = jnp.complex128(a);
print(b) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Here is a minimal working example, when I run this piece of code, the following error is issued
When I change
jax.numpy.complex128
tojax.numpy.complex64
, there will be no error. What is the reason?Beta Was this translation helpful? Give feedback.
All reactions