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

Function test_tensor_dlpack

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

Source from the content-addressed store, hash-verified

132 np.int8, np.int16, np.int32, np.int64,
133 np.float16, np.float32, np.float64,])
134def test_tensor_dlpack(np_type):
135 arr = np.array([1, 2, 3, 4, 5, 6, 1, 1])
136 expected = np.array(arr, dtype=np_type).reshape((2, 2, 2), order='C')
137 t = pa.Tensor.from_numpy(expected)
138 check_dlpack_export(t, expected)
139
140 expected = np.array(arr, dtype=np_type).reshape((2, 2, 2), order='F')
141 t = pa.Tensor.from_numpy(expected)
142 check_dlpack_export(t, expected)
143
144
145def multidim_arrays():

Callers

nothing calls this directly

Calls 2

check_dlpack_exportFunction · 0.85
arrayMethod · 0.45

Tested by

no test coverage detected