dpnp.isfinite

dpnp.isfinite = <DPNPUnaryFunc 'isfinite'>

Test each element \(x_i\) of the input array x to determine if finite.

For full documentation refer to numpy.isfinite.

Parameters:
x{dpnp.ndarray, usm_ndarray}

Input array, may have any data type.

out{None, dpnp.ndarray, usm_ndarray, tuple of ndarray}, optional

Output array to populate. Array must have the correct shape and the expected data type. A tuple (possible only as a keyword argument) must have length equal to the number of outputs.

Default: None.

order{None, "C", "F", "A", "K"}, optional

Memory layout of the newly output array, if parameter out is None.

Default: "K".

Returns:
outdpnp.ndarray of bool dtype

An array which is True where x is not positive infinity, negative infinity, or NaN, False otherwise.

Limitations

Parameters where and subok are supported with their default values. Otherwise NotImplementedError exception will be raised.

See also

dpnp.isinf

Test element-wise for positive or negative infinity.

dpnp.isneginf

Test element-wise for negative infinity, return result as bool array.

dpnp.isposinf

Test element-wise for positive infinity, return result as bool array.

dpnp.isnan

Test element-wise for NaN and return result as a boolean array.

Notes

Not a Number, positive infinity and negative infinity are considered to be non-finite.

Examples

>>> import dpnp as np
>>> x = np.array([-np.inf, 0., np.inf])
>>> np.isfinite(x)
array([False,  True, False])