MCPcopy Create free account
hub / github.com/numpy/numpy / test_dot_3args

Method test_dot_3args

numpy/core/tests/test_multiarray.py:6639–6659  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

6637 assert_allclose(c, d)
6638
6639 def test_dot_3args(self):
6640 from numpy.core.multiarray import dot
6641
6642 np.random.seed(22)
6643 f = np.random.random_sample((1024, 16))
6644 v = np.random.random_sample((16, 32))
6645
6646 r = np.empty((1024, 32))
6647 for i in range(12):
6648 dot(f, v, r)
6649 if HAS_REFCOUNT:
6650 assert_equal(sys.getrefcount(r), 2)
6651 r2 = dot(f, v, out=None)
6652 assert_array_equal(r2, r)
6653 assert_(r is dot(f, v, out=r))
6654
6655 v = v[:, 0].copy() # v.shape == (16,)
6656 r = r[:, 0].copy() # r.shape == (1024,)
6657 r2 = dot(f, v)
6658 assert_(r is dot(f, v, r))
6659 assert_array_equal(r2, r)
6660
6661 def test_dot_3args_errors(self):
6662 from numpy.core.multiarray import dot

Callers

nothing calls this directly

Calls 5

dotFunction · 0.90
assert_equalFunction · 0.90
assert_array_equalFunction · 0.90
assert_Function · 0.90
copyMethod · 0.45

Tested by

no test coverage detected