dpnp.isclose

dpnp.isclose(x1, x2, rtol=1e-05, atol=1e-08, equal_nan=False)[source]

Returns a boolean array where two arrays are element-wise equal within a tolerance.

For full documentation refer to numpy.isclose.

Limitations

x2 is supported to be integer if x1 is dpnp.ndarray or at least either x1 or x2 should be as dpnp.ndarray. Otherwise the function will be executed sequentially on CPU. Input array data types are limited by supported DPNP Available array data types.

See also

dpnp.allclose

Returns True if two arrays are element-wise equal within a tolerance.

Examples

>>> import dpnp as np
>>> x1 = np.array([1e10,1e-7])
>>> x2 = np.array([1.00001e10,1e-8])
>>> out = np.isclose(x1, x2)
>>> [i for i in out]
[True, False]