Skip to content

Latest commit

 

History

History
69 lines (51 loc) · 1.92 KB

testing.rst

File metadata and controls

69 lines (51 loc) · 1.92 KB

Testing Modules

cupy.testing

CuPy offers testing utilities to support unit testing. They are under namespace cupy.testing.

Standard Assertions

The assertions have same names as NumPy's ones. The difference from NumPy is that they can accept both numpy.ndarray and cupy.ndarray.

assert_allclose

assert_array_almost_equal

assert_array_almost_equal_nulp

assert_array_max_ulp

assert_array_equal

assert_array_list_equal

assert_array_less

NumPy-CuPy Consistency Check

The following decorators are for testing consistency between CuPy's functions and corresponding NumPy's ones.

numpy_cupy_allclose

numpy_cupy_array_almost_equal

numpy_cupy_array_almost_equal_nulp

numpy_cupy_array_max_ulp

numpy_cupy_array_equal

numpy_cupy_array_list_equal

numpy_cupy_array_less

numpy_cupy_raises

Parameterized dtype Test

The following decorators offer the standard way for parameterized test with respect to single or the combination of dtype(s).

for_dtypes

for_all_dtypes

for_float_dtypes

for_signed_dtypes

for_unsigned_dtypes

for_int_dtypes

for_dtypes_combination

for_all_dtypes_combination

for_signed_dtypes_combination

for_unsigned_dtypes_combination

for_int_dtypes_combination

Parameterized order Test

The following decorators offer the standard way to parameterize tests with orders.

for_orders

for_CF_orders