forked from data-apis/array-api-extra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_compat.pyi
27 lines (21 loc) · 877 Bytes
/
_compat.pyi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""Static type stubs for `_compat.py`."""
# https://github.com/scikit-learn/scikit-learn/pull/27910#issuecomment-2568023972
from __future__ import annotations
from types import ModuleType
from ._typing import Array, Device
# pylint: disable=missing-class-docstring,unused-argument
class ArrayModule(ModuleType):
def device(self, x: Array, /) -> Device: ...
def array_namespace(
*xs: Array,
api_version: str | None = None,
use_compat: bool | None = None,
) -> ArrayModule: ...
def device(x: Array, /) -> Device: ...
def is_cupy_namespace(x: object, /) -> bool: ...
def is_jax_array(x: object, /) -> bool: ...
def is_jax_namespace(x: object, /) -> bool: ...
def is_pydata_sparse_namespace(x: object, /) -> bool: ...
def is_torch_namespace(x: object, /) -> bool: ...
def is_writeable_array(x: object, /) -> bool: ...
def size(x: Array, /) -> int | None: ...