jax.numpy.isinf#
- jax.numpy.isinf(x, /)[source]#
Return a boolean array indicating whether each element of input is infinite.
JAX implementation of
numpy.isinf
.- Parameters:
x (ArrayLike) – input array or scalar.
- Returns:
A boolean array of same shape as
x
containingTrue
wherex
isinf
or-inf
, andFalse
otherwise.- Return type:
See also
jax.numpy.isposinf()
: Returns a boolean array indicating whether each element of input is positive infinity.jax.numpy.isneginf()
: Returns a boolean array indicating whether each element of input is negative infinity.jax.numpy.isfinite()
: Returns a boolean array indicating whether each element of input is finite.jax.numpy.isnan()
: Returns a boolean array indicating whether each element of input is not a number (NaN
).
Examples
>>> jnp.isinf(jnp.inf) Array(True, dtype=bool) >>> x = jnp.array([2+3j, -jnp.inf, 6, jnp.inf, jnp.nan]) >>> jnp.isinf(x) Array([False, True, False, True, False], dtype=bool)