|
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 |
|
@@ -229,6 +232,13 @@ def _xfail(reason: str) -> None:
|
229 | 232 | # TODO: remove xfail once
|
230 | 233 | # https://github.com/dask/dask/issues/8260 is resolved
|
231 | 234 | _xfail(reason="Bug in dask raising error on conversion")
|
| 235 | + elif ( |
| 236 | + source_library == "ndonnx" |
| 237 | + and target_library not in ("array_api_strict", "ndonnx", "numpy") |
| 238 | + ): |
| 239 | + _xfail(reason="The truth value of lazy Array Array(dtype=Boolean) is unknown") |
| 240 | + elif source_library == "ndonnx" and target_library == "numpy": |
| 241 | + _xfail(reason="produces numpy array of ndonnx scalar arrays") |
232 | 242 | elif source_library == "jax.numpy" and target_library == "torch":
|
233 | 243 | _xfail(reason="casts int to float")
|
234 | 244 | elif source_library == "cupy" and target_library != "cupy":
|
|
0 commit comments