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

Method test_buffer_protocol_ref_counting

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

Source from the content-addressed store, hash-verified

1783 self.assertEqual(b"abcdefghij", ab[1::2])
1784
1785 def test_buffer_protocol_ref_counting(self):
1786 a = mx.arange(3)
1787 wr = weakref.ref(a)
1788 self.assertIsNotNone(wr())
1789 mv = memoryview(a)
1790 a = None
1791 self.assertIsNotNone(wr())
1792 mv = None
1793 self.assertIsNone(wr())
1794
1795 def test_array_view_ref_counting(self):
1796 a = mx.arange(3)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected