图片解析应用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.0 KiB

  1. import sys
  2. from typing import TypeVar, overload, List, Sequence
  3. from numpy import ndarray
  4. from numpy.typing import ArrayLike
  5. if sys.version_info >= (3, 8):
  6. from typing import SupportsIndex
  7. else:
  8. from typing_extensions import SupportsIndex
  9. _ArrayType = TypeVar("_ArrayType", bound=ndarray)
  10. @overload
  11. def atleast_1d(__arys: ArrayLike) -> ndarray: ...
  12. @overload
  13. def atleast_1d(*arys: ArrayLike) -> List[ndarray]: ...
  14. @overload
  15. def atleast_2d(__arys: ArrayLike) -> ndarray: ...
  16. @overload
  17. def atleast_2d(*arys: ArrayLike) -> List[ndarray]: ...
  18. @overload
  19. def atleast_3d(__arys: ArrayLike) -> ndarray: ...
  20. @overload
  21. def atleast_3d(*arys: ArrayLike) -> List[ndarray]: ...
  22. def vstack(tup: Sequence[ArrayLike]) -> ndarray: ...
  23. def hstack(tup: Sequence[ArrayLike]) -> ndarray: ...
  24. @overload
  25. def stack(
  26. arrays: Sequence[ArrayLike], axis: SupportsIndex = ..., out: None = ...
  27. ) -> ndarray: ...
  28. @overload
  29. def stack(
  30. arrays: Sequence[ArrayLike], axis: SupportsIndex = ..., out: _ArrayType = ...
  31. ) -> _ArrayType: ...
  32. def block(arrays: ArrayLike) -> ndarray: ...