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

Method test_dlpack_device

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

Source from the content-addressed store, hash-verified

90 assert shape == np.from_dlpack(x).shape
91
92 def test_dlpack_device(self):
93 x = np.arange(5)
94 assert x.__dlpack_device__() == (1, 0)
95 y = np.from_dlpack(x)
96 assert y.__dlpack_device__() == (1, 0)
97 z = y[::2]
98 assert z.__dlpack_device__() == (1, 0)
99
100 def dlpack_deleter_exception(self):
101 x = np.arange(5)

Callers

nothing calls this directly

Calls 1

__dlpack_device__Method · 0.80

Tested by

no test coverage detected