From 6b11b2bf2ac6f34aa415d34409e50c75fe21b338 Mon Sep 17 00:00:00 2001 From: Thomas Li <47963215+lithomas1@users.noreply.github.com> Date: Fri, 22 Nov 2024 17:28:41 -0500 Subject: [PATCH] Wrap dask.array by default since it is not Array API Compatible --- array_api_compat/common/_helpers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/array_api_compat/common/_helpers.py b/array_api_compat/common/_helpers.py index 706821c4..5e71b84a 100644 --- a/array_api_compat/common/_helpers.py +++ b/array_api_compat/common/_helpers.py @@ -521,7 +521,10 @@ def your_function(x, y): import torch namespaces.add(torch) elif is_dask_array(x): - if _use_compat: + # dask main namespace is not array API compatible + # so return namespace from array-api-compat unless + # explicitly requested otherwise + if _use_compat or _use_compat is None: _check_api_version(api_version) from ..dask import array as dask_namespace namespaces.add(dask_namespace)