Esempio n. 1
0
def test_nn():
    "Test that bn.nn gives the same output as bn.slow.nn."
    msg = '\nfunc %s | input %s (%s) | axis %s\n'
    msg += '\nInput array `arr`:\n%s\n'
    msg += '\nInput array `arr0`:\n%s\n'
    count = -1
    for arr, arr0, axis in arrays2():
        actual = bn.nn(arr, arr0, axis)
        desired = bn.slow.nn(arr, arr0, axis)
        count += 1
        tup = ('bn.nn', 'arr'+str(count), str(arr.dtype),
               str(axis), arr, arr0)
        err_msg = msg % tup
        assert_almost_equal(actual, desired, decimal=5, err_msg=err_msg)
def test_nn():
    "Test nn."
    a = [[1, 2], [3, 4]]
    a0 = [1, 2]
    assert_equal(bn.nn(a, a0), bn.slow.nn(a, a0))
Esempio n. 3
0
def test_nn():
    "Test nn."
    a = [[1, 2], [3, 4]]
    a0 = [1, 2]
    assert_equal(bn.nn(a, a0), bn.slow.nn(a, a0))