cupy.allclose#

cupy.allclose(a, b, rtol=1e-05, atol=1e-08, equal_nan=False)[source]#

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

Two values in a and b are considiered equal when the following equation is satisfied.

\[|a - b| \le \mathrm{atol} + \mathrm{rtol} |b|\]
Parameters:
  • a (cupy.ndarray) – Input array to compare.

  • b (cupy.ndarray) – Input array to compare.

  • rtol (float) – The relative tolerance.

  • atol (float) – The absolute tolerance.

  • equal_nan (bool) – If True, NaN’s in a will be considered equal to NaN’s in b.

Returns:

A boolean 0-dim array. If its value is True, two arrays are element-wise equal within a tolerance.

Return type:

cupy.ndarray

See also

numpy.allclose()