diff --git a/paddle/fluid/pybind/eager_method.cc b/paddle/fluid/pybind/eager_method.cc index 5d12e85b1336b..7ad3780cdb3d5 100644 --- a/paddle/fluid/pybind/eager_method.cc +++ b/paddle/fluid/pybind/eager_method.cc @@ -142,7 +142,7 @@ Returns a numpy array shows the value of current Tensor. >>> import paddle >>> x = paddle.to_tensor([[1.0, 2.0, 3.0], - [4.0, 5.0, 6.0]]) + ... [4.0, 5.0, 6.0]]) >>> x.numpy() array([[1., 2., 3.], [4., 5., 6.]], dtype=float32) diff --git a/python/paddle/amp/auto_cast.py b/python/paddle/amp/auto_cast.py index 19f182252a92a..4da8092030434 100644 --- a/python/paddle/amp/auto_cast.py +++ b/python/paddle/amp/auto_cast.py @@ -23,6 +23,8 @@ List, Literal, Protocol, + Set, + Tuple, TypeVar, Union, overload, @@ -54,7 +56,7 @@ from paddle.static import Operator, Program _AmpLevelLiteral = Literal["O0", "OD", "O1", "O2"] - _CustomList: TypeAlias = Union[list[str], tuple[str, ...], set[str]] + _CustomList: TypeAlias = Union[List[str], Tuple[str, ...], Set[str]] class _OptimizerLike(Protocol): def minimize( diff --git a/python/paddle/vision/transforms/transforms.py b/python/paddle/vision/transforms/transforms.py index e7916dcf4bab6..0584f836d43ff 100644 --- a/python/paddle/vision/transforms/transforms.py +++ b/python/paddle/vision/transforms/transforms.py @@ -918,7 +918,7 @@ class Normalize(BaseTransform[_InputT, _RetT]): ... data_format='HWC') ... >>> fake_img = paddle.rand([300,320,3]).numpy() * 255. - >>> fake_img = normalize(fake_img) + >>> fake_img = normalize(fake_img) # type: ignore[call-overload] >>> print(fake_img.shape) (300, 320, 3) >>> print(fake_img.max(), fake_img.min())