MCPcopy Create free account
hub / github.com/apache/arrow / test_array_from_dlpack

Function test_array_from_dlpack

python/pyarrow/tests/test_dlpack.py:406–411  ·  view source on GitHub ↗
(np_type)

Source from the content-addressed store, hash-verified

404 np.int8, np.int16, np.int32, np.int64,
405 np.float16, np.float32, np.float64])
406def test_array_from_dlpack(np_type):
407 expected = np.array([1, 2, 3, 4, 5], dtype=np_type)
408 arr = pa.Array.from_dlpack(expected)
409 arr.validate(full=True)
410 assert isinstance(arr, pa.Array)
411 np.testing.assert_array_equal(arr.to_numpy(), expected, strict=True)
412
413
414@requires_numpy_version("2.1.0")

Callers

nothing calls this directly

Calls 2

arrayMethod · 0.45
validateMethod · 0.45

Tested by

no test coverage detected