dpnp.tensor.allclose

dpnp.tensor.allclose(a1, a2, atol=1e-08, rtol=1e-05, equal_nan=False)[source]

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

The testing is based on the following elementwise comparison:

abs(a - b) <= max(atol, rtol * max(abs(a), abs(b)))

Parameters:
  • a1 (usm_ndarray) -- First input array.

  • a2 (usm_ndarray) -- Second input array.

  • atol (float, optional) --

    Absolute tolerance.

    Default: 1e-8.

  • rtol (float, optional) --

    Relative tolerance.

    Default: 1e-5.

  • equal_nan (bool, optional) --

    Whether to compare NaN's as equal.

    Default: False.

Returns:

out -- True if the two arrays are equal within the given tolerances.

Return type:

bool