未验证 提交 6402424f 编写于 作者: T Tao Luo 提交者: GitHub

Merge pull request #15773 from chengduoZH/fix_shape_api_doc

Fix shape api doc
...@@ -35,14 +35,15 @@ class ShapeOp : public framework::OperatorWithKernel { ...@@ -35,14 +35,15 @@ class ShapeOp : public framework::OperatorWithKernel {
class ShapeOpMaker : public framework::OpProtoAndCheckerMaker { class ShapeOpMaker : public framework::OpProtoAndCheckerMaker {
public: public:
void Make() override { void Make() override {
AddInput("Input", "(Tensor), The input tensor."); AddInput("Input", "(LoDTensor), The input tensor.");
AddOutput("Out", AddOutput(
"(Tensor), The shape of input tensor, the data type of the shape" "Out",
" is int32_t, will be on the same device with the input Tensor."); "(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( 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"); )DOC");
} }
}; };
......
...@@ -8744,16 +8744,17 @@ def slice(input, axes, starts, ends): ...@@ -8744,16 +8744,17 @@ def slice(input, axes, starts, ends):
return out return out
@templatedoc()
def shape(input): def shape(input):
""" """
${comment} **Shape Layer**
Get the shape of the input.
Args: Args:
input (Variable): ${input_comment} input (Variable): The input variable.
Returns: Returns:
out (Variable): ${out_comment} Variable: The shape of the input variable.
Examples: Examples:
.. code-block:: python .. code-block:: python
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册