From 3ce12b1b8e9ae4bb43567e79b081b6cdc4e4ceeb Mon Sep 17 00:00:00 2001 From: chengduozh Date: Mon, 18 Feb 2019 16:42:16 +0800 Subject: [PATCH] fix shape api doc test=develop --- paddle/fluid/operators/shape_op.cc | 13 +++++++------ python/paddle/fluid/layers/nn.py | 8 +++++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/paddle/fluid/operators/shape_op.cc b/paddle/fluid/operators/shape_op.cc index 1be9fe47af7..efc497fa47d 100644 --- a/paddle/fluid/operators/shape_op.cc +++ b/paddle/fluid/operators/shape_op.cc @@ -35,14 +35,15 @@ class ShapeOp : public framework::OperatorWithKernel { class ShapeOpMaker : public framework::OpProtoAndCheckerMaker { public: void Make() override { - AddInput("Input", "(Tensor), The input tensor."); - AddOutput("Out", - "(Tensor), The shape of input tensor, the data type of the shape" - " is int32_t, will be on the same device with the input Tensor."); + AddInput("Input", "(LoDTensor), The input tensor."); + AddOutput( + "Out", + "(LoDTensor), The shape of input tensor, the data type of the shape" + " is int32_t, will be on the same device with the input Tensor."); AddComment(R"DOC( -Shape Operator +Shape Operator. -Get the shape of input tensor. Only support CPU input Tensor now. +Return the shape of the input. )DOC"); } }; diff --git a/python/paddle/fluid/layers/nn.py b/python/paddle/fluid/layers/nn.py index 46ce58fd2db..69885fd17af 100644 --- a/python/paddle/fluid/layers/nn.py +++ b/python/paddle/fluid/layers/nn.py @@ -8710,13 +8710,15 @@ def slice(input, axes, starts, ends): @templatedoc() def shape(input): """ - ${comment} + **Shape Layer** + + Return the shape of the input. Args: - input (Variable): ${input_comment} + input (Variable): The input variable. Returns: - out (Variable): ${out_comment} + out (Variable): The shape of the input variable. Examples: .. code-block:: python -- GitLab