Open jorenham opened 5 months ago
There are some "stubs" within the array-api repo already: https://github.com/data-apis/array-api/tree/2023.12/src/array_api_stubs
But they have one tiny issue; they don't make any sense at all, and are completely useless in their current state. Sadly, it appears to me as if it'd be faster to rewrite them from scratch, then to attempt to fix it.
For example; the use of typing.TypeVar
is almost always incorrect. It looks as if the authors believe that a TypeVar
can be used as some sort of global placeholder for to-be-defined types 🤷🏻.
update
This comment seems to confirm my hunch:
"""
Types for type annotations used in the array API standard.
The type variables should be replaced with the actual types for a given
library, e.g., for NumPy TypeVar('array') would be replaced with ndarray.
"""
https://data-apis.org/array-api/latest/API_specification/array_object.html
__array_namespace__
__dlpack__
__dlpack_device__
This won't require (optional) runtime dependencies