jax.numpy.isfinite#
- jax.numpy.isfinite(x, /)[source]#
Return a boolean array indicating whether each element of input is finite.
JAX implementation of
numpy.isfinite.- Parameters:
x (ArrayLike) – input array or scalar.
- Returns:
A boolean array of same shape as
xcontainingTruewherexis notinf,-inf, orNaN, andFalseotherwise.- Return type:
See also
jax.numpy.isinf(): Returns a boolean array indicating whether each element of input is either positive or negative infinity.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.isnan(): Returns a boolean array indicating whether each element of input is not a number (NaN).
Examples
>>> x = jnp.array([-1, 3, jnp.inf, jnp.nan]) >>> jnp.isfinite(x) Array([ True, True, False, False], dtype=bool) >>> jnp.isfinite(3-4j) Array(True, dtype=bool, weak_type=True)