dpnp.isneginf
- dpnp.isneginf(x, out=None)[source]
Test element-wise for negative infinity, return result as bool array.
For full documentation refer to
numpy.isneginf.- 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
Nonethen an array is returned with valuesTruewhere the corresponding element of the input is negative infinity and valuesFalsewhere the element of the input is not negative infinity. If out is notNonethen the result is stored there and out is a reference to that array.- Return type:
dpnp.ndarray of bool dtype
See also
dpnp.isinfTest element-wise for positive or negative infinity.
dpnp.isposinfTest element-wise for positive infinity, return result as bool array.
dpnp.isnanTest element-wise for NaN and return result as a boolean array.
dpnp.isfiniteTest element-wise for finiteness.
Examples
>>> import dpnp as np >>> x = np.array(np.inf) >>> np.isneginf(-x) array(True) >>> np.isneginf(x) array(False)
>>> x = np.array([-np.inf, 0., np.inf]) >>> np.isneginf(x) array([ True, False, False])
>>> x = np.array([-np.inf, 0., np.inf]) >>> y = np.zeros(x.shape, dtype='bool') >>> np.isneginf(x, y) array([ True, False, False]) >>> y array([ True, False, False])