From 085b9619f531237bf7fea0337b827500cdf03c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E7=81=BF?= <646741404@qq.com> Date: Wed, 21 Oct 2020 11:12:23 +0800 Subject: [PATCH] fix bugs test=develop (#28125) --- python/paddle/tensor/math.py | 2 +- python/paddle/tensor/random.py | 2 ++ python/paddle/tensor/search.py | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/python/paddle/tensor/math.py b/python/paddle/tensor/math.py index 19ba7f1b38..895d0c1759 100755 --- a/python/paddle/tensor/math.py +++ b/python/paddle/tensor/math.py @@ -1100,7 +1100,7 @@ def max(x, axis=None, keepdim=False, name=None): float64, int32, int64. axis(list|int, optional): The axis along which the maximum is computed. If :attr:`None`, compute the maximum over all elements of - `x` and return a Tensor variable with a single element, + `x` and return a Tensor variable with a single element, otherwise must be in the range :math:`[-x.ndim(x), x.ndim(x))`. If :math:`axis[i] < 0`, the axis to reduce is :math:`x.ndim + axis[i]`. keepdim(bool, optional): Whether to reserve the reduced dimension in the diff --git a/python/paddle/tensor/random.py b/python/paddle/tensor/random.py index eb9750bcc3..3a0435e776 100644 --- a/python/paddle/tensor/random.py +++ b/python/paddle/tensor/random.py @@ -380,7 +380,9 @@ def uniform(shape, dtype=None, min=-1.0, max=1.0, seed=0, name=None): distribution in the range [``min``, ``max``), with ``shape`` and ``dtype``. Examples: + :: + Input: shape = [1, 2] Output: diff --git a/python/paddle/tensor/search.py b/python/paddle/tensor/search.py index 7adf1b7cc4..3b79067302 100644 --- a/python/paddle/tensor/search.py +++ b/python/paddle/tensor/search.py @@ -62,7 +62,9 @@ def argsort(x, axis=-1, descending=False, name=None): and with data type int64). Examples: + .. code-block:: python + import paddle paddle.disable_static() @@ -358,6 +360,7 @@ def nonzero(x, as_tuple=False): .. code-block:: python + import paddle x1 = paddle.to_tensor([[1.0, 0.0, 0.0], -- GitLab