Пример #1
0
def assert_all_close(X, Y, rtol=1e-05, atol=1e-08):
    """Assert all values of two matrices are similar.

    Parameters
    ----------
    rtol : relative (multiplicative) tolerance of error
    atol : absolute (additive) tolerance of error
    """
    X = toarray(X)
    Y = toarray(Y)
    np.testing.assert_allclose(X, Y, rtol=rtol, atol=atol)
Пример #2
0
def assert_all_equal(X, Y):
    """Assert all values of two matrices are the same."""
    X = toarray(X)
    Y = toarray(Y)
    np.testing.assert_array_equal(X, Y)