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)
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)
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
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))
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