diff --git a/python/paddle/static/input.py b/python/paddle/static/input.py index 763608bec3ce6a..91be8eac6fe626 100644 --- a/python/paddle/static/input.py +++ b/python/paddle/static/input.py @@ -39,6 +39,8 @@ from ..base.variable_index import _setitem_static if TYPE_CHECKING: + from collections.abc import Sequence + from paddle import Tensor from paddle._typing import DTypeLike, ShapeLike, Size1 @@ -419,7 +421,11 @@ def __ne__(self, other) -> bool: return not self == other -def setitem(x, index, value): +def setitem( + x: Tensor, + index: int | slice | Sequence[int] | Tensor | None, + value: Tensor | npt.NDArray[Any] | bool | complex, +) -> Tensor: """ x(Tensor): input Tensor. index(Scalar|Tuple|List|Tensor): Where should be set value.