isfinite

Contents

isfinite#

class brainunit.math.isfinite(a)#

Test element-wise for finiteness (not inf and not NaN).

Parameters:

a (saiunit.Quantity | Array | ndarray | bool | number | bool | int | float | complex) – Input array.

Returns:

out – Boolean array of the same shape as a.

Return type:

Array

Examples

>>> import jax.numpy as jnp
>>> import saiunit.math as sumath
>>> sumath.isfinite(jnp.array([1.0, jnp.inf, jnp.nan]))
Array([ True, False, False], dtype=bool)