cupy.testing.numpy_cupy_array_almost_equal_nulp¶
-
cupy.testing.
numpy_cupy_array_almost_equal_nulp
(nulp=1, name='xp', type_check=True, accept_error=False)[source]¶ Decorator that checks results of NumPy and CuPy are equal w.r.t. spacing.
Parameters: - nulp (int) – The maximum number of unit in the last place for tolerance.
- name (str) – Argument name whose value is either
numpy
orcupy
module. - type_check (bool) – If
True
, consistency of dtype is also checked. - accept_error (bool, Exception or tuple of Exception) – Sepcify
acceptable errors. When both NumPy test and CuPy test raises the
same type of errors, and the type of the errors is specified with
this argument, the errors are ignored and not raised.
If it is
True
all error types are acceptable. If it isFalse
no error is acceptable.
Decorated test fixture is required to return the same arrays in the sense of
cupy.testing.assert_array_almost_equal_nulp()
(except the type of array module) even ifxp
isnumpy
orcupy
.