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

Method test_array_view_ref_counting

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

Source from the content-addressed store, hash-verified

1793 self.assertIsNone(wr())
1794
1795 def test_array_view_ref_counting(self):
1796 a = mx.arange(3)
1797 wr = weakref.ref(a)
1798 self.assertIsNotNone(wr())
1799 a_np = np.array(a, copy=False)
1800 a = None
1801 self.assertIsNotNone(wr())
1802 a_np = None
1803 self.assertIsNone(wr())
1804
1805 def test_create_from_buffer(self):
1806 x = mx.array(b"Hello")

Callers

nothing calls this directly

Calls 1

arrayMethod · 0.60

Tested by

no test coverage detected