from collections.abc import Sequence from typing import TypeVar, Any, overload, Union, Literal from numpy import ( ndarray, dtype, bool_, number, _OrderKACF, ) from numpy._typing import ( _ArrayLikeBool_co, _ArrayLikeUInt_co, _ArrayLikeInt_co, _ArrayLikeFloat_co, _ArrayLikeComplex_co, _ArrayLikeObject_co, _DTypeLikeBool, _DTypeLikeUInt, _DTypeLikeInt, _DTypeLikeFloat, _DTypeLikeComplex, _DTypeLikeComplex_co, _DTypeLikeObject, ) _ArrayType = TypeVar( "_ArrayType", bound=ndarray[Any, dtype[Union[bool_, number[Any]]]], ) _OptimizeKind = None | bool | Literal["greedy", "optimal"] | Sequence[Any] _CastingSafe = Literal["no", "equiv", "safe", "same_kind"] _CastingUnsafe = Literal["unsafe"] __all__: list[str] # TODO: Properly handle the `casting`-based combinatorics # TODO: We need to evaluate the content `__subscripts` in order # to identify whether or an array or scalar is returned. At a cursory # glance this seems like something that can quite easily be done with # a mypy plugin. # Something like `is_scalar = bool(__subscripts.partition("->")[-1])` @overload def einsum( subscripts: str | _ArrayLikeInt_co, /, *operands: _ArrayLikeBool_co, out: None = ..., dtype: None | _DTypeLikeBool = ..., order: _OrderKACF = ..., casting: _CastingSafe = ..., optimize: _OptimizeKind = ..., ) -> Any: ... @overload def einsum( subscripts: str | _ArrayLikeInt_co, /, *operands: _ArrayLikeUInt_co, out: None = ..., dtype: None | _DTypeLikeUInt = ..., order: _OrderKACF = ..., casting: _CastingSafe = ..., optimize: _OptimizeKind = ..., ) -> Any: ... @overload def einsum( subscripts: str | _ArrayLikeInt_co, /, *operands: _ArrayLikeInt_co, out: None = ..., dtype: None | _DTypeLikeInt = ..., order: _OrderKACF = ..., casting: _CastingSafe = ..., optimize: _OptimizeKind = ..., ) -> Any: ... @overload def einsum( subscripts: str | _ArrayLikeInt_co, /, *operands: _ArrayLikeFloat_co, out: None = ..., dtype: None | _DTypeLikeFloat = ..., order: _OrderKACF = ..., casting: _CastingSafe = ..., optimize: _OptimizeKind = ..., ) -> Any: ... @overload def einsum( subscripts: str | _ArrayLikeInt_co, /, *operands: _ArrayLikeComplex_co, out: None = ..., dtype: None | _DTypeLikeComplex = ..., order: _OrderKACF = ..., casting: _CastingSafe = ..., optimize: _OptimizeKind = ..., ) -> Any: ... @overload def einsum( subscripts: str | _ArrayLikeInt_co, /, *operands: Any, casting: _CastingUnsafe, dtype: None | _DTypeLikeComplex_co = ..., out: None = ..., order: _OrderKACF = ..., optimize: _OptimizeKind = ..., ) -> Any: ... @overload def einsum( subscripts: str | _ArrayLikeInt_co, /, *operands: _ArrayLikeComplex_co, out: _ArrayType, dtype: None | _DTypeLikeComplex_co = ..., order: _OrderKACF = ..., casting: _CastingSafe = ..., optimize: _OptimizeKind = ..., ) -> _ArrayType: ... @overload def einsum( subscripts: str | _ArrayLikeInt_co, /, *operands: Any, out: _ArrayType, casting: _CastingUnsafe, dtype: None | _DTypeLikeComplex_co = ..., order: _OrderKACF = ..., optimize: _OptimizeKind = ..., ) -> _ArrayType: ... @overload def einsum( subscripts: str | _ArrayLikeInt_co, /, *operands: _ArrayLikeObject_co, out: None = ..., dtype: None | _DTypeLikeObject = ..., order: _OrderKACF = ..., casting: _CastingSafe = ..., optimize: _OptimizeKind = ..., ) -> Any: ... @overload def einsum( subscripts: str | _ArrayLikeInt_co, /, *operands: Any, casting: _CastingUnsafe, dtype: None | _DTypeLikeObject = ..., out: None = ..., order: _OrderKACF = ..., optimize: _OptimizeKind = ..., ) -> Any: ... @overload def einsum( subscripts: str | _ArrayLikeInt_co, /, *operands: _ArrayLikeObject_co, out: _ArrayType, dtype: None | _DTypeLikeObject = ..., order: _OrderKACF = ..., casting: _CastingSafe = ..., optimize: _OptimizeKind = ..., ) -> _ArrayType: ... @overload def einsum( subscripts: str | _ArrayLikeInt_co, /, *operands: Any, out: _ArrayType, casting: _CastingUnsafe, dtype: None | _DTypeLikeObject = ..., order: _OrderKACF = ..., optimize: _OptimizeKind = ..., ) -> _ArrayType: ... # NOTE: `einsum_call` is a hidden kwarg unavailable for public use. # It is therefore excluded from the signatures below. # NOTE: In practice the list consists of a `str` (first element) # and a variable number of integer tuples. def einsum_path( subscripts: str | _ArrayLikeInt_co, /, *operands: _ArrayLikeComplex_co | _DTypeLikeObject, optimize: _OptimizeKind = ..., ) -> tuple[list[Any], str]: ...
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
__pycache__ | Folder | 0755 |
|
|
include | Folder | 0755 |
|
|
lib | Folder | 0755 |
|
|
tests | Folder | 0755 |
|
|
__init__.py | File | 5.64 KB | 0644 |
|
__init__.pyi | File | 126 B | 0644 |
|
_add_newdocs.py | File | 204.07 KB | 0644 |
|
_add_newdocs_scalars.py | File | 11.82 KB | 0644 |
|
_asarray.py | File | 3.79 KB | 0644 |
|
_asarray.pyi | File | 1.06 KB | 0644 |
|
_dtype.py | File | 10.36 KB | 0644 |
|
_dtype_ctypes.py | File | 3.59 KB | 0644 |
|
_exceptions.py | File | 5.25 KB | 0644 |
|
_internal.py | File | 27.68 KB | 0644 |
|
_internal.pyi | File | 1.01 KB | 0644 |
|
_machar.py | File | 11.29 KB | 0644 |
|
_methods.py | File | 8.41 KB | 0644 |
|
_multiarray_tests.cpython-311-x86_64-linux-gnu.so | File | 171.4 KB | 0755 |
|
_multiarray_umath.cpython-311-x86_64-linux-gnu.so | File | 6.64 MB | 0755 |
|
_operand_flag_tests.cpython-311-x86_64-linux-gnu.so | File | 16.55 KB | 0755 |
|
_rational_tests.cpython-311-x86_64-linux-gnu.so | File | 58.29 KB | 0755 |
|
_simd.cpython-311-x86_64-linux-gnu.so | File | 2.47 MB | 0755 |
|
_string_helpers.py | File | 2.79 KB | 0644 |
|
_struct_ufunc_tests.cpython-311-x86_64-linux-gnu.so | File | 16.65 KB | 0755 |
|
_type_aliases.py | File | 7.36 KB | 0644 |
|
_type_aliases.pyi | File | 404 B | 0644 |
|
_ufunc_config.py | File | 13.62 KB | 0644 |
|
_ufunc_config.pyi | File | 1.04 KB | 0644 |
|
_umath_tests.cpython-311-x86_64-linux-gnu.so | File | 41.01 KB | 0755 |
|
arrayprint.py | File | 62.12 KB | 0644 |
|
arrayprint.pyi | File | 4.32 KB | 0644 |
|
cversions.py | File | 347 B | 0644 |
|
defchararray.py | File | 71.89 KB | 0644 |
|
defchararray.pyi | File | 9 KB | 0644 |
|
einsumfunc.py | File | 50.65 KB | 0644 |
|
einsumfunc.pyi | File | 4.75 KB | 0644 |
|
fromnumeric.py | File | 125.8 KB | 0644 |
|
fromnumeric.pyi | File | 22.96 KB | 0644 |
|
function_base.py | File | 19.37 KB | 0644 |
|
function_base.pyi | File | 4.61 KB | 0644 |
|
generate_numpy_api.py | File | 7.47 KB | 0644 |
|
getlimits.py | File | 25.26 KB | 0644 |
|
getlimits.pyi | File | 82 B | 0644 |
|
memmap.py | File | 11.5 KB | 0644 |
|
memmap.pyi | File | 55 B | 0644 |
|
multiarray.py | File | 54.78 KB | 0644 |
|
multiarray.pyi | File | 24.19 KB | 0644 |
|
numeric.py | File | 75.21 KB | 0644 |
|
numeric.pyi | File | 13.9 KB | 0644 |
|
numerictypes.py | File | 17.67 KB | 0644 |
|
numerictypes.pyi | File | 3.19 KB | 0644 |
|
overrides.py | File | 6.93 KB | 0644 |
|
records.py | File | 36.65 KB | 0644 |
|
records.pyi | File | 5.56 KB | 0644 |
|
setup.py | File | 47.05 KB | 0644 |
|
setup_common.py | File | 16.68 KB | 0644 |
|
shape_base.py | File | 29.05 KB | 0644 |
|
shape_base.pyi | File | 2.71 KB | 0644 |
|
umath.py | File | 1.99 KB | 0644 |
|
umath_tests.py | File | 389 B | 0644 |
|