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

Method test_active_memory_count

python/tests/test_memory.py:61–73  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

59 mx.set_wired_limit(max_size + 10)
60
61 def test_active_memory_count(self):
62 mx.synchronize()
63 mx.clear_cache()
64 init_mem = mx.get_active_memory()
65 a = mx.zeros((128, 128))
66 mx.eval(a)
67 mx.synchronize()
68 del a
69 a = mx.zeros((90, 128))
70 mx.eval(a)
71 mx.synchronize()
72 del a
73 self.assertEqual(init_mem, mx.get_active_memory())
74
75
76if __name__ == "__main__":

Callers

nothing calls this directly

Calls 4

synchronizeMethod · 0.45
clear_cacheMethod · 0.45
get_active_memoryMethod · 0.45
evalMethod · 0.45

Tested by

no test coverage detected