jax.numpy.real#

jax.numpy.real(val, /)[source]#

Return element-wise real part of the complex argument.

JAX implementation of numpy.real.

Parameters:

val (ArrayLike) – input array or scalar.

Returns:

An array containing the real part of the elements of val.

Return type:

Array

See also

Examples

>>> jnp.real(5)
Array(5, dtype=int32, weak_type=True)
>>> jnp.real(2j)
Array(0., dtype=float32, weak_type=True)
>>> x = jnp.array([3-2j, 4+7j, -2j])
>>> jnp.real(x)
Array([ 3.,  4., -0.], dtype=float32)