dpnp.isposinf

dpnp.isposinf(x, out=None)[source]

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

For full documentation refer to numpy.isposinf.

Parameters:
  • x ({dpnp.ndarray, usm_ndarray}) -- Input array.

  • out ({None, dpnp.ndarray, usm_ndarray}, optional) --

    A location into which the result is stored. If provided, it must have a shape that the input broadcasts to and a boolean data type. If not provided or None, a freshly-allocated boolean array is returned.

    Default: None.

Returns:

out -- An array with the same shape as x. If out is None then an array is returned with values True where the corresponding element of the input is positive infinity and values False where the element of the input is not positive infinity. If out is not None then the result is stored there and out is a reference to that array.

Return type:

dpnp.ndarray of bool dtype

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.isnan

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

dpnp.isfinite

Test element-wise for finiteness.

Examples

>>> import dpnp as np
>>> x = np.array(np.inf)
>>> np.isposinf(x)
array(True)
>>> np.isposinf(-x)
array(False)
>>> x = np.array([-np.inf, 0., np.inf])
>>> np.isposinf(x)
array([False, False,  True])
>>> x = np.array([-np.inf, 0., np.inf])
>>> y = np.zeros(x.shape, dtype='bool')
>>> np.isposinf(x, y)
array([False, False,  True])
>>> y
array([False, False,  True])