sf.math.allclose

math.allclose(array2, atol=1e-09)

Whether two arrays are equal within tolerance.

The two arrays are compaired element-wise.

Parameters:
  • array1 (ndarray[Tuple[int, ...], Union[TypeVar(R, float16, float32, float64), TypeVar(C, complex64, complex128), TypeVar(Z, int16, int32, int64), TypeVar(N, uint16, uint32, uint64)]]) – An array.

  • array2 (ndarray[Tuple[int, ...], Union[TypeVar(R, float16, float32, float64), TypeVar(C, complex64, complex128), TypeVar(Z, int16, int32, int64), TypeVar(N, uint16, uint32, uint64)]]) – Another array.

  • atol – The absolute tolerance.

Return type:

bool

Returns:

Whether two arrays are equal within tolerance.

Raises:

ValueError – If the shape of the two arrays do not match.