From 7049f301ee1b8aabe4d2376a821a78b4c783cf7f Mon Sep 17 00:00:00 2001 From: danleifeng <52735331+danleifeng@users.noreply.github.com> Date: Mon, 20 Apr 2020 14:58:29 +0800 Subject: [PATCH] fix example bug;test=develop (#23893) --- python/paddle/tensor/creation.py | 5 ++++- python/paddle/tensor/linalg.py | 4 ++-- python/paddle/tensor/math.py | 6 +++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/python/paddle/tensor/creation.py b/python/paddle/tensor/creation.py index 64c82accd7..09cb6bec78 100644 --- a/python/paddle/tensor/creation.py +++ b/python/paddle/tensor/creation.py @@ -404,7 +404,8 @@ def eye(num_rows, name=None): """ **eye** - This function constructs an identity tensor, or a batch of tensor. + This function constructs an identity tensor. + Args: num_rows(int): the number of rows in each batch tensor. num_columns(int, optional): the number of columns in each batch tensor. @@ -417,8 +418,10 @@ def eye(num_rows, stop_gradient(bool, optional): Whether stop calculating gradients. Default:True. 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` + Returns: Variable: An identity Tensor or LoDTensor of shape [num_rows, num_columns]. + Examples: .. code-block:: python import paddle diff --git a/python/paddle/tensor/linalg.py b/python/paddle/tensor/linalg.py index 76b459327c..6597b5f822 100644 --- a/python/paddle/tensor/linalg.py +++ b/python/paddle/tensor/linalg.py @@ -476,11 +476,11 @@ def t(input, name=None): the fluid.layers.transpose function which perm dimensions set 0 and 1. Args: - input (Variable): The input Tensor. It is a N-D (N<=2) Tensor of data types float32, float64, int32. + input (Variable): The input Tensor. It is a N-D (N<=2) Tensor of data types float16, float32, float64, int32. 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` Returns: - Variable: A transposed n-D Tensor, with data type being float32, float64, int32, int64. + Variable: A transposed n-D Tensor, with data type being float16, float32, float64, int32, int64. For Example: .. code-block:: text diff --git a/python/paddle/tensor/math.py b/python/paddle/tensor/math.py index c4feb007a9..8eeabaa236 100644 --- a/python/paddle/tensor/math.py +++ b/python/paddle/tensor/math.py @@ -1108,7 +1108,7 @@ def max(input, dim=None, keep_dim=False, out=None, name=None): .. code-block:: python import paddle import paddle.fluid as fluid - + # x is a Tensor variable with following elements: # [[0.2, 0.3, 0.5, 0.9] # [0.1, 0.2, 0.6, 0.7]] @@ -1158,6 +1158,7 @@ def max(input, dim=None, keep_dim=False, out=None, name=None): def min(input, dim=None, keep_dim=False, out=None, name=None): """ Computes the minimum of tensor elements over the given dimension. + Args: input (Variable): The input variable which is a Tensor, the data type is float32, float64, int32, int64. @@ -1175,9 +1176,11 @@ def min(input, dim=None, keep_dim=False, out=None, name=None): if out is None, a new Varibale will be create to store the result. 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` + Returns: Variable: Tensor, result of minimum on the specified dim of input tensor, it's data type is the same as input's Tensor. + Examples: .. code-block:: python import paddle @@ -1242,6 +1245,7 @@ def log1p(x, out=None, name=None): user to set this property. For more information, please refer to :ref:`api_guide_Name` Returns: Variable: The natural log of the input LoDTensor or Tensor computed element-wise. + Examples: .. code-block:: python import paddle -- GitLab