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

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

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

    np.divide(anp, bnp, out=anp)
    lg.divide(a, b, out=a)

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

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

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

    return
예제 #4
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.divide(a, b), np.divide(anp, bnp))
예제 #5
0
def test():
    random.seed(13)
    a = random.randint(1, 42)
    b = random.randint(1, 3)

    # test divide
    assert np.array_equal(lg.divide(a, b), np.divide(a, b))

    return