From 2fc479c05f9f3270001db60cfa640e84efcb5fbf Mon Sep 17 00:00:00 2001 From: kuizhiqing Date: Mon, 20 Dec 2021 14:13:42 +0800 Subject: [PATCH] fix repeat doc, test=document_fix (#38238) --- python/paddle/tensor/manipulation.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python/paddle/tensor/manipulation.py b/python/paddle/tensor/manipulation.py index a03b179e883..66a990f6dc7 100644 --- a/python/paddle/tensor/manipulation.py +++ b/python/paddle/tensor/manipulation.py @@ -2593,7 +2593,7 @@ def repeat_interleave(x, repeats, axis=None, name=None): Args: x (Tensor): The input Tensor to be operated. The data of ``x`` can be one of float32, float64, int32, int64. repeats (Tensor or int): The number of repetitions for each element. repeats is broadcasted to fit the shape of the given axis. - axis (int, optional): The dimension in which we manipulate. Default: if None, the output tensor is flatten. + axis (int, optional): The dimension in which we manipulate. Default: None, the output tensor is flatten. name(str, optional): The default value is None. Normally there is no need for user to set this property. For more information, please refer to :ref:`api_guide_Name`. @@ -2601,6 +2601,11 @@ def repeat_interleave(x, repeats, axis=None, name=None): Returns: Tensor: A Tensor with same data type as ``x``. + Examples: + .. code-block:: python + + import paddle + x = paddle.to_tensor([[1, 2, 3], [4, 5, 6]]) repeats = paddle.to_tensor([3, 2, 1], dtype='int32') -- GitLab