def test():
    anp = np.random.randn(4, 5)
    b = random.randint(1, 13)
    a = lg.array(anp)

    np.subtract(anp, b, out=anp)
    lg.subtract(a, b, out=a)

    assert np.array_equal(a, anp)
    return
예제 #2
0
def test():
    anp = np.random.randn(4, 5)
    b = random.randint(1, 13)
    a = lg.array(anp)

    # test with scalar on rhs
    assert np.array_equal(lg.subtract(a, b), np.subtract(anp, b))

    # test with scalar on lhs
    assert np.array_equal(lg.subtract(b, a), np.subtract(b, anp))

    return
예제 #3
0
def test():
    anp = np.random.randn(4, 5)
    bnp = np.random.randn(4, 5)
    a = lg.array(anp)
    b = lg.array(bnp)

    assert np.array_equal(lg.subtract(a, b), np.subtract(anp, bnp))

    return
예제 #4
0
def test():
    a = random.randint(1, 13)
    b = random.randint(1, 13)
    assert np.array_equal(lg.subtract(a, b), np.subtract(a, b))

    return