MCPcopy Create free account
hub / github.com/ml-explore/mlx / test_siblings_without_eval

Method test_siblings_without_eval

python/tests/test_array.py:2222–2242  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2220
2221 @unittest.skipIf(platform.system() == "Windows", "Memory info not accurate")
2222 def test_siblings_without_eval(self):
2223 def get_mem():
2224 process = psutil.Process(os.getpid())
2225 return process.memory_info().rss
2226
2227 key = mx.array([1, 2])
2228
2229 def t():
2230 a, b = mx.split(key, 2)
2231 a = mx.reshape(a, [])
2232 b = mx.reshape(b, [])
2233 return b
2234
2235 mx.synchronize()
2236 t()
2237 gc.collect()
2238 expected = get_mem()
2239 for _ in range(100):
2240 t()
2241 used = get_mem()
2242 self.assertEqual(expected, used)
2243
2244 def test_scalar_integer_conversion_overflow(self):
2245 y = mx.array(2000000000, dtype=mx.int32)

Callers

nothing calls this directly

Calls 2

arrayMethod · 0.60
synchronizeMethod · 0.45

Tested by

no test coverage detected