m2m模型翻译
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.

66 lines
1.3 KiB

6 months ago
  1. from typing import Any, overload, TypeVar, List, Union
  2. from numpy import floating, bool_, object_, ndarray
  3. from numpy.typing import (
  4. NDArray,
  5. _FloatLike_co,
  6. _ArrayLikeFloat_co,
  7. _ArrayLikeObject_co,
  8. )
  9. _ArrayType = TypeVar("_ArrayType", bound=ndarray[Any, Any])
  10. __all__: List[str]
  11. @overload
  12. def fix( # type: ignore[misc]
  13. x: _FloatLike_co,
  14. out: None = ...,
  15. ) -> floating[Any]: ...
  16. @overload
  17. def fix(
  18. x: _ArrayLikeFloat_co,
  19. out: None = ...,
  20. ) -> NDArray[floating[Any]]: ...
  21. @overload
  22. def fix(
  23. x: _ArrayLikeObject_co,
  24. out: None = ...,
  25. ) -> NDArray[object_]: ...
  26. @overload
  27. def fix(
  28. x: Union[_ArrayLikeFloat_co, _ArrayLikeObject_co],
  29. out: _ArrayType,
  30. ) -> _ArrayType: ...
  31. @overload
  32. def isposinf( # type: ignore[misc]
  33. x: _FloatLike_co,
  34. out: None = ...,
  35. ) -> bool_: ...
  36. @overload
  37. def isposinf(
  38. x: _ArrayLikeFloat_co,
  39. out: None = ...,
  40. ) -> NDArray[bool_]: ...
  41. @overload
  42. def isposinf(
  43. x: _ArrayLikeFloat_co,
  44. out: _ArrayType,
  45. ) -> _ArrayType: ...
  46. @overload
  47. def isneginf( # type: ignore[misc]
  48. x: _FloatLike_co,
  49. out: None = ...,
  50. ) -> bool_: ...
  51. @overload
  52. def isneginf(
  53. x: _ArrayLikeFloat_co,
  54. out: None = ...,
  55. ) -> NDArray[bool_]: ...
  56. @overload
  57. def isneginf(
  58. x: _ArrayLikeFloat_co,
  59. out: _ArrayType,
  60. ) -> _ArrayType: ...