cupy.testing.numpy_cupy_raises¶
-
cupy.testing.
numpy_cupy_raises
(name='xp', sp_name=None, scipy_name=None, accept_error=<class 'Exception'>)[source]¶ Decorator that checks the NumPy and CuPy throw same errors.
Parameters: - name (str) – Argument name whose value is either
numpy
orcupy
module. - sp_name (str or None) – Argument name whose value is either
scipy.sparse
orcupyx.scipy.sparse
module. IfNone
, no argument is given for the modules. - scipy_name (str or None) – Argument name whose value is either
scipy
orcupyx.scipy
module. IfNone
, no argument is given for the modules. - accept_error (bool, Exception or tuple of Exception) – Specify
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 throw same errors even if
xp
isnumpy
orcupy
.- name (str) – Argument name whose value is either