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

Function test___array__

numpy/array_api/tests/test_array_object.py:336–341  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

334 assert b.mT.shape == (3, 2)
335
336def test___array__():
337 a = ones((2, 3), dtype=int16)
338 assert np.asarray(a) is a._array
339 b = np.asarray(a, dtype=np.float64)
340 assert np.all(np.equal(b, np.ones((2, 3), dtype=np.float64)))
341 assert b.dtype == np.float64
342
343def test_allow_newaxis():
344 a = ones(5)

Callers

nothing calls this directly

Calls 2

onesFunction · 0.50
allMethod · 0.45

Tested by

no test coverage detected