MCPcopy Index your code
hub / github.com/numpy/numpy / test_dot_3args

Method test_dot_3args

numpy/_core/tests/test_multiarray.py:7610–7631  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

7608 assert_allclose(c, d)
7609
7610 def test_dot_3args(self):
7611
7612 np.random.seed(22)
7613 f = np.random.random_sample((1024, 16))
7614 v = np.random.random_sample((16, 32))
7615
7616 r = np.empty((1024, 32))
7617 if HAS_REFCOUNT:
7618 orig_refcount = sys.getrefcount(r)
7619 for i in range(12):
7620 dot(f, v, r)
7621 if HAS_REFCOUNT:
7622 assert_equal(sys.getrefcount(r), orig_refcount)
7623 r2 = dot(f, v, out=None)
7624 assert_array_equal(r2, r)
7625 assert_(r is dot(f, v, out=r))
7626
7627 v = v[:, 0].copy() # v.shape == (16,)
7628 r = r[:, 0].copy() # r.shape == (1024,)
7629 r2 = dot(f, v)
7630 assert_(r is dot(f, v, r))
7631 assert_array_equal(r2, r)
7632
7633 def test_dot_3args_errors(self):
7634

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