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

Method test_dunder_dlpack_refcount

numpy/core/tests/test_dlpack.py:10–15  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

8class TestDLPack:
9 @pytest.mark.skipif(IS_PYPY, reason="PyPy can't get refcounts.")
10 def test_dunder_dlpack_refcount(self):
11 x = np.arange(5)
12 y = x.__dlpack__()
13 assert sys.getrefcount(x) == 3
14 del y
15 assert sys.getrefcount(x) == 2
16
17 def test_dunder_dlpack_stream(self):
18 x = np.arange(5)

Callers

nothing calls this directly

Calls 1

__dlpack__Method · 0.45

Tested by

no test coverage detected