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 -- Boolean array of same shape as x.

Return type:

dpnp.ndarray

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])