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

Function test_overlap

numpy/_core/tests/test_einsum.py:1332–1341  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1330 np.einsum('{}...a{}->{}...a{}'.format(*sp), arr)
1331
1332def test_overlap():
1333 a = np.arange(9, dtype=int).reshape(3, 3)
1334 b = np.arange(9, dtype=int).reshape(3, 3)
1335 d = np.dot(a, b)
1336 # sanity check
1337 c = np.einsum('ij,jk->ik', a, b)
1338 assert_equal(c, d)
1339 # gh-10080, out overlaps one of the operands
1340 c = np.einsum('ij,jk->ik', a, b, out=b)
1341 assert_equal(c, d)
1342
1343def test_einsum_chunking_precision():
1344 """Most einsum operations are reductions and until NumPy 2.3 reductions

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
reshapeMethod · 0.80
dotMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…