array-api-compat
array-api-compat copied to clipboard
Compatibility layer for common array libraries to support the Array API
In my understanding, `dtype` can be any Python object in array API specification, and therefore may be `None` depending on the library. If the device is somewhat set to `None`...
https://github.com/data-apis/array-api/pull/848#issuecomment-2638722698
Consider the following script: ```python from concurrent.futures import ThreadPoolExecutor from pkgutil import walk_packages import scipy def worker(): for _ in walk_packages(scipy.__path__, scipy.__name__ + '.'): pass n_threads=10 tpe = ThreadPoolExecutor(max_workers=min((n_threads, 4)))...
With NumPy >= 2.0: ```python3 import numpy as np from scipy._lib._array_api import array_namespace x1 = np.asarray([0.667, 0.667, 0.667]) x2 = np.asarray([0.123, 0.456, 0.789]) xp = array_namespace(x1, x2) xp.vecdot(x1, x2) #...
I stumbled into an edge case when trying to apply `torch.vmap` to some code I had rewritten to utilize array-api-compat. So far everything seems to work just fine, with the...
[cuPyNumeric](https://docs.nvidia.com/cupynumeric/latest/) aims to be a drop-in replacement for NumPy, with full API compatibility achieved by automatically falling back to NumPy for any functionality which isn't yet implemented. I suspect this...
Dear all, I run the following command when xp is cupy ```python # cupy x = cupy.asarray([1.0] * 3) xp = array_api_compat.array_namespace(x) E = xp.eye(3, 3, k=0, dtype='float64', device=1) print(E.device)...
Currently dask is missing some functions in the linear algebra module, and the fft module is apparently noncompliant. I haven't double checked this list, but a list of unavailable functions...
In https://data-apis.org/array-api/latest/design_topics/copies_views_and_mutation.html, the Standard says > Array API consumers are strongly advised to avoid any mutating operations when an array object may [...] be a “view” [...] It is not...