jax.numpy.imag#

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

Return element-wise imaginary of part of the complex argument.

JAX implementation of numpy.imag.

Parameters:

val (ArrayLike) – input array or scalar.

Returns:

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

Return type:

Array

See also

Examples

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