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

Method test_memory_contraints

numpy/core/tests/test_einsum.py:1102–1118  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1100 assert_(ret)
1101
1102 def test_memory_contraints(self):
1103 # Ensure memory constraints are satisfied
1104
1105 outer_test = self.build_operands('a,b,c->abc')
1106
1107 path, path_str = np.einsum_path(*outer_test, optimize=('greedy', 0))
1108 self.assert_path_equal(path, ['einsum_path', (0, 1, 2)])
1109
1110 path, path_str = np.einsum_path(*outer_test, optimize=('optimal', 0))
1111 self.assert_path_equal(path, ['einsum_path', (0, 1, 2)])
1112
1113 long_test = self.build_operands('acdf,jbje,gihb,hfac')
1114 path, path_str = np.einsum_path(*long_test, optimize=('greedy', 0))
1115 self.assert_path_equal(path, ['einsum_path', (0, 1, 2, 3)])
1116
1117 path, path_str = np.einsum_path(*long_test, optimize=('optimal', 0))
1118 self.assert_path_equal(path, ['einsum_path', (0, 1, 2, 3)])
1119
1120 def test_long_paths(self):
1121 # Long complex cases

Callers

nothing calls this directly

Calls 2

build_operandsMethod · 0.95
assert_path_equalMethod · 0.95

Tested by

no test coverage detected