MCPcopy Index your code
hub / github.com/numpy/numpy / test_take_refcount

Method test_take_refcount

numpy/_core/tests/test_regression.py:1574–1585  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1572
1573 @pytest.mark.skipif(not HAS_REFCOUNT, reason="Python lacks refcounts")
1574 def test_take_refcount(self):
1575 # ticket #939
1576 a = np.arange(16, dtype=float).reshape((4, 4))
1577 lut = np.ones((5 + 3, 4), float)
1578 rgba = np.empty(shape=a.shape + (4,), dtype=lut.dtype)
1579 c1 = sys.getrefcount(rgba)
1580 try:
1581 lut.take(a, axis=0, mode='clip', out=rgba)
1582 except TypeError:
1583 pass
1584 c2 = sys.getrefcount(rgba)
1585 assert_equal(c1, c2)
1586
1587 def test_fromfile_tofile_seeks(self):
1588 # tofile/fromfile used to get (#1610) the Python file handle out of sync

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
reshapeMethod · 0.80
takeMethod · 0.80

Tested by

no test coverage detected