Initial configuration commit
This commit is contained in:
commit
31c8abea59
266 changed files with 780274 additions and 0 deletions
476
typings/numpy/array_api/_array_object.pyi
Normal file
476
typings/numpy/array_api/_array_object.pyi
Normal file
|
@ -0,0 +1,476 @@
|
|||
"""
|
||||
This type stub file was generated by pyright.
|
||||
"""
|
||||
|
||||
import types
|
||||
import numpy.typing as npt
|
||||
import numpy as np
|
||||
from enum import IntEnum
|
||||
from typing import Any, Optional, TYPE_CHECKING, Tuple, Union
|
||||
from ._typing import Any, Device, Dtype, PyCapsule
|
||||
|
||||
"""
|
||||
Wrapper class around the ndarray object for the array API standard.
|
||||
|
||||
The array API standard defines some behaviors differently than ndarray, in
|
||||
particular, type promotion rules are different (the standard has no
|
||||
value-based casting). The standard also specifies a more limited subset of
|
||||
array methods and functionalities than are implemented on ndarray. Since the
|
||||
goal of the array_api namespace is to be a minimal implementation of the array
|
||||
API standard, we need to define a separate wrapper class for the array_api
|
||||
namespace.
|
||||
|
||||
The standard compliant class is only a wrapper class. It is *not* a subclass
|
||||
of ndarray.
|
||||
"""
|
||||
if TYPE_CHECKING:
|
||||
...
|
||||
class Array:
|
||||
"""
|
||||
n-d array object for the array API namespace.
|
||||
|
||||
See the docstring of :py:obj:`np.ndarray <numpy.ndarray>` for more
|
||||
information.
|
||||
|
||||
This is a wrapper around numpy.ndarray that restricts the usage to only
|
||||
those things that are required by the array API namespace. Note,
|
||||
attributes on this object that start with a single underscore are not part
|
||||
of the API specification and should only be used internally. This object
|
||||
should not be constructed directly. Rather, use one of the creation
|
||||
functions, such as asarray().
|
||||
|
||||
"""
|
||||
_array: np.ndarray[Any, Any]
|
||||
def __new__(cls, *args, **kwargs):
|
||||
...
|
||||
|
||||
def __str__(self: Array, /) -> str:
|
||||
"""
|
||||
Performs the operation __str__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __repr__(self: Array, /) -> str:
|
||||
"""
|
||||
Performs the operation __repr__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __array__(self, dtype: None | np.dtype[Any] = ...) -> npt.NDArray[Any]:
|
||||
"""
|
||||
Warning: this method is NOT part of the array API spec. Implementers
|
||||
of other libraries need not include it, and users should not assume it
|
||||
will be present in other implementations.
|
||||
|
||||
"""
|
||||
...
|
||||
|
||||
def __abs__(self: Array, /) -> Array:
|
||||
"""
|
||||
Performs the operation __abs__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __add__(self: Array, other: Union[int, float, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __add__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __and__(self: Array, other: Union[int, bool, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __and__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __array_namespace__(self: Array, /, *, api_version: Optional[str] = ...) -> types.ModuleType:
|
||||
...
|
||||
|
||||
def __bool__(self: Array, /) -> bool:
|
||||
"""
|
||||
Performs the operation __bool__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __complex__(self: Array, /) -> complex:
|
||||
"""
|
||||
Performs the operation __complex__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __dlpack__(self: Array, /, *, stream: None = ...) -> PyCapsule:
|
||||
"""
|
||||
Performs the operation __dlpack__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __dlpack_device__(self: Array, /) -> Tuple[IntEnum, int]:
|
||||
"""
|
||||
Performs the operation __dlpack_device__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __eq__(self: Array, other: Union[int, float, bool, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __eq__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __float__(self: Array, /) -> float:
|
||||
"""
|
||||
Performs the operation __float__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __floordiv__(self: Array, other: Union[int, float, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __floordiv__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __ge__(self: Array, other: Union[int, float, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __ge__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __getitem__(self: Array, key: Union[int, slice, ellipsis, Tuple[Union[int, slice, ellipsis], ...], Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __getitem__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __gt__(self: Array, other: Union[int, float, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __gt__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __int__(self: Array, /) -> int:
|
||||
"""
|
||||
Performs the operation __int__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __index__(self: Array, /) -> int:
|
||||
"""
|
||||
Performs the operation __index__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __invert__(self: Array, /) -> Array:
|
||||
"""
|
||||
Performs the operation __invert__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __le__(self: Array, other: Union[int, float, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __le__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __lshift__(self: Array, other: Union[int, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __lshift__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __lt__(self: Array, other: Union[int, float, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __lt__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __matmul__(self: Array, other: Array, /) -> Array:
|
||||
"""
|
||||
Performs the operation __matmul__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __mod__(self: Array, other: Union[int, float, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __mod__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __mul__(self: Array, other: Union[int, float, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __mul__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __ne__(self: Array, other: Union[int, float, bool, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __ne__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __neg__(self: Array, /) -> Array:
|
||||
"""
|
||||
Performs the operation __neg__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __or__(self: Array, other: Union[int, bool, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __or__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __pos__(self: Array, /) -> Array:
|
||||
"""
|
||||
Performs the operation __pos__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __pow__(self: Array, other: Union[int, float, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __pow__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __rshift__(self: Array, other: Union[int, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __rshift__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __setitem__(self, key: Union[int, slice, ellipsis, Tuple[Union[int, slice, ellipsis], ...], Array], value: Union[int, float, bool, Array], /) -> None:
|
||||
"""
|
||||
Performs the operation __setitem__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __sub__(self: Array, other: Union[int, float, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __sub__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __truediv__(self: Array, other: Union[float, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __truediv__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __xor__(self: Array, other: Union[int, bool, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __xor__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __iadd__(self: Array, other: Union[int, float, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __iadd__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __radd__(self: Array, other: Union[int, float, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __radd__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __iand__(self: Array, other: Union[int, bool, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __iand__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __rand__(self: Array, other: Union[int, bool, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __rand__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __ifloordiv__(self: Array, other: Union[int, float, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __ifloordiv__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __rfloordiv__(self: Array, other: Union[int, float, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __rfloordiv__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __ilshift__(self: Array, other: Union[int, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __ilshift__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __rlshift__(self: Array, other: Union[int, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __rlshift__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __imatmul__(self: Array, other: Array, /) -> Array:
|
||||
"""
|
||||
Performs the operation __imatmul__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __rmatmul__(self: Array, other: Array, /) -> Array:
|
||||
"""
|
||||
Performs the operation __rmatmul__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __imod__(self: Array, other: Union[int, float, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __imod__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __rmod__(self: Array, other: Union[int, float, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __rmod__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __imul__(self: Array, other: Union[int, float, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __imul__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __rmul__(self: Array, other: Union[int, float, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __rmul__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __ior__(self: Array, other: Union[int, bool, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __ior__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __ror__(self: Array, other: Union[int, bool, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __ror__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __ipow__(self: Array, other: Union[int, float, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __ipow__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __rpow__(self: Array, other: Union[int, float, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __rpow__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __irshift__(self: Array, other: Union[int, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __irshift__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __rrshift__(self: Array, other: Union[int, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __rrshift__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __isub__(self: Array, other: Union[int, float, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __isub__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __rsub__(self: Array, other: Union[int, float, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __rsub__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __itruediv__(self: Array, other: Union[float, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __itruediv__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __rtruediv__(self: Array, other: Union[float, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __rtruediv__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __ixor__(self: Array, other: Union[int, bool, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __ixor__.
|
||||
"""
|
||||
...
|
||||
|
||||
def __rxor__(self: Array, other: Union[int, bool, Array], /) -> Array:
|
||||
"""
|
||||
Performs the operation __rxor__.
|
||||
"""
|
||||
...
|
||||
|
||||
def to_device(self: Array, device: Device, /, stream: None = ...) -> Array:
|
||||
...
|
||||
|
||||
@property
|
||||
def dtype(self) -> Dtype:
|
||||
"""
|
||||
Array API compatible wrapper for :py:meth:`np.ndarray.dtype <numpy.ndarray.dtype>`.
|
||||
|
||||
See its docstring for more information.
|
||||
"""
|
||||
...
|
||||
|
||||
@property
|
||||
def device(self) -> Device:
|
||||
...
|
||||
|
||||
@property
|
||||
def mT(self) -> Array:
|
||||
...
|
||||
|
||||
@property
|
||||
def ndim(self) -> int:
|
||||
"""
|
||||
Array API compatible wrapper for :py:meth:`np.ndarray.ndim <numpy.ndarray.ndim>`.
|
||||
|
||||
See its docstring for more information.
|
||||
"""
|
||||
...
|
||||
|
||||
@property
|
||||
def shape(self) -> Tuple[int, ...]:
|
||||
"""
|
||||
Array API compatible wrapper for :py:meth:`np.ndarray.shape <numpy.ndarray.shape>`.
|
||||
|
||||
See its docstring for more information.
|
||||
"""
|
||||
...
|
||||
|
||||
@property
|
||||
def size(self) -> int:
|
||||
"""
|
||||
Array API compatible wrapper for :py:meth:`np.ndarray.size <numpy.ndarray.size>`.
|
||||
|
||||
See its docstring for more information.
|
||||
"""
|
||||
...
|
||||
|
||||
@property
|
||||
def T(self) -> Array:
|
||||
"""
|
||||
Array API compatible wrapper for :py:meth:`np.ndarray.T <numpy.ndarray.T>`.
|
||||
|
||||
See its docstring for more information.
|
||||
"""
|
||||
...
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue