From fb672621f4feda403a83495d5cc386b9de56b9f0 Mon Sep 17 00:00:00 2001 From: Steffy-zxf Date: Fri, 6 Nov 2020 15:41:47 +0800 Subject: [PATCH 1/2] test=document_fix --- python/paddle/tensor/math.py | 66 +++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/python/paddle/tensor/math.py b/python/paddle/tensor/math.py index c83e788538e1c..74a61a6f6ed5a 100755 --- a/python/paddle/tensor/math.py +++ b/python/paddle/tensor/math.py @@ -720,37 +720,41 @@ def sum(x, axis=None, dtype=None, keepdim=False, name=None): @templatedoc(op_type="sum") def add_n(inputs, name=None): """ - ${comment} - - Case 1: - :: - Input: - Input. Shape = [2, 3] - Input = [[1, 2, 3], - [4, 5, 6]] - - Output: - The output. Shape = [2, 3] - Output = [[1, 2, 3], - [4, 5, 6]] - - Case 2: - :: - Input: - First input: - Input1. Shape = [2, 3] - Input1 = [[1, 2, 3], - [4, 5, 6]] - - The second input: - Input2. Shape = [2, 3] - Input2 = [[7, 8, 9], - [10, 11, 12]] - - Output: - The output. Shape = [2, 3] - Output = [[8, 10, 12], - [14, 16, 18]] + This OP is used to sum one or more Tensor of the input. + + For example: + + .. code-block::text + + Case 1: + + Input: + input.shape = [2, 3] + input = [[1, 2, 3], + [4, 5, 6]] + + Output: + output.shape = [2, 3] + output = [[1, 2, 3], + [4, 5, 6]] + + Case 2: + + Input: + First input: + input1.shape = [2, 3] + Input1 = [[1, 2, 3], + [4, 5, 6]] + + The second input: + input2.shape = [2, 3] + input2 = [[7, 8, 9], + [10, 11, 12]] + + Output: + output.shape = [2, 3] + output = [[8, 10, 12], + [14, 16, 18]] Args: inputs (Tensor|list(Tensor)): A Tensor list. The shape and data type of the list elements should be consistent. From 2cb1df2a638d50cb69c366423363d3aafb00e21b Mon Sep 17 00:00:00 2001 From: Steffy-zxf Date: Tue, 10 Nov 2020 19:58:57 +0800 Subject: [PATCH 2/2] test=document_fix --- python/paddle/tensor/math.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/paddle/tensor/math.py b/python/paddle/tensor/math.py index 195315e6b3385..9ce5a379dd045 100755 --- a/python/paddle/tensor/math.py +++ b/python/paddle/tensor/math.py @@ -722,7 +722,7 @@ def add_n(inputs, name=None): For example: - .. code-block::text + .. code-block:: text Case 1: