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

Function test_array_to_tensor_dlpack_nulls

python/pyarrow/tests/test_dlpack.py:230–236  ·  view source on GitHub ↗
(arr, expected)

Source from the content-addressed store, hash-verified

228@check_bytes_allocated
229@pytest.mark.parametrize(('arr', 'expected'), multidim_arrays_with_nulls())
230def test_array_to_tensor_dlpack_nulls(arr, expected):
231 with pytest.raises(pa.ArrowInvalid, match="Array contains nulls"):
232 arr.to_tensor()
233
234 tensor = arr.to_tensor(allow_nulls=True)
235 result = np.from_dlpack(DLPackForwarder(tensor, max_version=(1, 0)))
236 np.testing.assert_array_equal(result, expected, strict=True)
237
238
239def dlpack_objects():

Callers

nothing calls this directly

Calls 1

DLPackForwarderClass · 0.85

Tested by

no test coverage detected