Skip to content

[Typing][A-69] Add type annotations for LR Schedulers #65209

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion python/paddle/_typing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@

# Shape
from .shape import (
DynamicShapeLike as DynamicShapeLike,
ShapeLike as ShapeLike,
Size1 as Size1,
Size2 as Size2,
Expand Down
14 changes: 7 additions & 7 deletions python/paddle/_typing/shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@
# limitations under the License.
from __future__ import annotations

from typing import TYPE_CHECKING, List, Tuple, Union
from typing import TYPE_CHECKING, List, Sequence, Tuple, Union

from typing_extensions import TypeAlias

if TYPE_CHECKING:
from .. import Tensor

DynamicShapeLike: TypeAlias = Union[
Tuple[Union[int, "Tensor", None], ...],
List[Union[int, "Tensor", None]],
_DynamicShapeLike: TypeAlias = Union[
Sequence[Union[int, "Tensor", None]],
"Tensor",
]


ShapeLike: TypeAlias = Union[
Tuple[int, ...],
List[int],
_StaticShapeLike: TypeAlias = Union[
Sequence[int],
"Tensor",
]

ShapeLike: TypeAlias = Union[_DynamicShapeLike, _StaticShapeLike]


# for size parameters, eg, kernel_size, stride ...
Size1: TypeAlias = Union[int, Tuple[int], List[int]]
Expand Down
Loading