Raises an AssertionError if objects are not equal up to desired precision. Args: x(numpy.ndarray or cupy.ndarray): The actual object to check. y(numpy.ndarray or cupy.ndarray): The desired, expected object. decimal(int): Desired precision. err_msg(str): The e
(
actual, desired, decimal=6, err_msg='', verbose=True,
)
| 49 | |
| 50 | |
| 51 | def assert_array_almost_equal( |
| 52 | actual, desired, decimal=6, err_msg='', verbose=True, |
| 53 | ): |
| 54 | """Raises an AssertionError if objects are not equal up to desired precision. |
| 55 | |
| 56 | Args: |
| 57 | x(numpy.ndarray or cupy.ndarray): The actual object to check. |
| 58 | y(numpy.ndarray or cupy.ndarray): The desired, expected object. |
| 59 | decimal(int): Desired precision. |
| 60 | err_msg(str): The error message to be printed in case of failure. |
| 61 | verbose(bool): If ``True``, the conflicting |
| 62 | values are appended to the error message. |
| 63 | |
| 64 | .. seealso:: :func:`numpy.testing.assert_array_almost_equal` |
| 65 | """ # NOQA |
| 66 | numpy.testing.assert_array_almost_equal( |
| 67 | cupy.asnumpy(actual), cupy.asnumpy(desired), decimal=decimal, |
| 68 | err_msg=err_msg, verbose=verbose, |
| 69 | ) |
| 70 | |
| 71 | |
| 72 | def assert_array_almost_equal_nulp(x, y, nulp=1): |
no outgoing calls