Merge pull request #15773 from chengduoZH/fix_shape_api_doc

Fix shape api doc
revert-15774-anakin_subgraph_engine
Tao Luo 6 years ago committed by GitHub
commit 6402424f7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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");
}
};

@ -8744,16 +8744,17 @@ def slice(input, axes, starts, ends):
return out
@templatedoc()
def shape(input):
"""
${comment}
**Shape Layer**
Get the shape of the input.
Args:
input (Variable): ${input_comment}
input (Variable): The input variable.
Returns:
out (Variable): ${out_comment}
Variable: The shape of the input variable.
Examples:
.. code-block:: python

Loading…
Cancel
Save