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

Function test_array_properties

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

Source from the content-addressed store, hash-verified

321 assert_raises(ValueError, lambda: asarray(a, device='gpu'))
322
323def test_array_properties():
324 a = ones((1, 2, 3))
325 b = ones((2, 3))
326 assert_raises(ValueError, lambda: a.T)
327
328 assert isinstance(b.T, Array)
329 assert b.T.shape == (3, 2)
330
331 assert isinstance(a.mT, Array)
332 assert a.mT.shape == (1, 3, 2)
333 assert isinstance(b.mT, Array)
334 assert b.mT.shape == (3, 2)
335
336def test___array__():
337 a = ones((2, 3), dtype=int16)

Callers

nothing calls this directly

Calls 2

assert_raisesFunction · 0.90
onesFunction · 0.50

Tested by

no test coverage detected