|
8 | 8 | from array_api_compat import ( # noqa: F401
|
9 | 9 | is_numpy_array, is_cupy_array, is_torch_array,
|
10 | 10 | is_dask_array, is_jax_array, is_pydata_sparse_array,
|
| 11 | + is_ndonnx_array, |
11 | 12 | is_numpy_namespace, is_cupy_namespace, is_torch_namespace,
|
12 | 13 | is_dask_namespace, is_jax_namespace, is_pydata_sparse_namespace,
|
13 |
| - is_array_api_strict_namespace, |
| 14 | + is_array_api_strict_namespace, is_ndonnx_namespace, |
14 | 15 | )
|
15 | 16 |
|
16 | 17 | from array_api_compat import (
|
|
25 | 26 | 'dask.array': 'is_dask_array',
|
26 | 27 | 'jax.numpy': 'is_jax_array',
|
27 | 28 | 'sparse': 'is_pydata_sparse_array',
|
| 29 | + 'ndonnx': 'is_ndonnx_array', |
28 | 30 | }
|
29 | 31 |
|
30 | 32 | is_namespace_functions = {
|
|
35 | 37 | 'jax.numpy': 'is_jax_namespace',
|
36 | 38 | 'sparse': 'is_pydata_sparse_namespace',
|
37 | 39 | 'array_api_strict': 'is_array_api_strict_namespace',
|
| 40 | + 'ndonnx': 'is_ndonnx_namespace', |
38 | 41 | }
|
39 | 42 |
|
40 | 43 |
|
@@ -232,6 +235,13 @@ def _xfail(reason: str) -> None:
|
232 | 235 | # TODO: remove xfail once
|
233 | 236 | # https://github.com/dask/dask/issues/8260 is resolved
|
234 | 237 | _xfail(reason="Bug in dask raising error on conversion")
|
| 238 | + elif ( |
| 239 | + source_library == "ndonnx" |
| 240 | + and target_library not in ("array_api_strict", "ndonnx", "numpy") |
| 241 | + ): |
| 242 | + _xfail(reason="The truth value of lazy Array Array(dtype=Boolean) is unknown") |
| 243 | + elif source_library == "ndonnx" and target_library == "numpy": |
| 244 | + _xfail(reason="produces numpy array of ndonnx scalar arrays") |
235 | 245 | elif source_library == "jax.numpy" and target_library == "torch":
|
236 | 246 | _xfail(reason="casts int to float")
|
237 | 247 | elif source_library == "cupy" and target_library != "cupy":
|
|
0 commit comments