diff --git a/paddle/operators/elementwise_add_op.cc b/paddle/operators/elementwise_add_op.cc index d9bc80c869c023caebf0b45ed24f2def3f0b1dd8..ebe1de90c7d245756de759d8675a30f955843798 100644 --- a/paddle/operators/elementwise_add_op.cc +++ b/paddle/operators/elementwise_add_op.cc @@ -22,7 +22,7 @@ class ElementwiseAddOpMaker : public ElementwiseOpMaker { ElementwiseAddOpMaker(framework::OpProto* proto, framework::OpAttrChecker* op_checker) : ElementwiseOpMaker(proto, op_checker) { - SetComment("add", "Out = X + Y"); + SetComment("Add", "$Out = X + Y$"); AddComment(comment_); } }; diff --git a/paddle/operators/elementwise_div_op.cc b/paddle/operators/elementwise_div_op.cc index 3f56344d0007b5f14fd9b5b9b44a9b29d3c42f2a..de75816a249002549940b04d928c88c17d075917 100644 --- a/paddle/operators/elementwise_div_op.cc +++ b/paddle/operators/elementwise_div_op.cc @@ -22,7 +22,7 @@ class ElementwiseDivOpMaker : public ElementwiseOpMaker { ElementwiseDivOpMaker(framework::OpProto* proto, framework::OpAttrChecker* op_checker) : ElementwiseOpMaker(proto, op_checker) { - SetComment("Div", "Out = X / Y"); + SetComment("Div", "$Out = X / Y$"); AddComment(comment_); } }; diff --git a/paddle/operators/elementwise_mul_op.cc b/paddle/operators/elementwise_mul_op.cc index da7765aa6a7a81c9e0b4f462022cad54c16aec47..ffa10486f123963274aa478eb4c607e32138bcec 100644 --- a/paddle/operators/elementwise_mul_op.cc +++ b/paddle/operators/elementwise_mul_op.cc @@ -23,7 +23,7 @@ class ElementwiseMulOpMaker : public ElementwiseOpMaker { ElementwiseMulOpMaker(framework::OpProto* proto, framework::OpAttrChecker* op_checker) : ElementwiseOpMaker(proto, op_checker) { - SetComment("Mul", "Out = X ⊙ Y"); + SetComment("Mul", "$Out = X \\odot\\ Y$"); AddComment(comment_); } }; diff --git a/paddle/operators/elementwise_op.h b/paddle/operators/elementwise_op.h index fce4b24a22f40c9cc57738273a758d0d48ff5e91..56e5eb69bc382a2c15d88b759fa6987f02c6cabb 100644 --- a/paddle/operators/elementwise_op.h +++ b/paddle/operators/elementwise_op.h @@ -46,37 +46,42 @@ class ElementwiseOpMaker : public framework::OpProtoAndCheckerMaker { ElementwiseOpMaker(framework::OpProto* proto, framework::OpAttrChecker* op_checker) : OpProtoAndCheckerMaker(proto, op_checker) { - AddInput("X", R"DOC( -The first input of elementwise op, it's a tensor of any dimensions. -)DOC"); - AddInput("Y", R"DOC( -The sencond input of elementwise op, it's a tensor and it's dimensions -must be small or equal to X's dimensions. -)DOC"); + AddInput("X", "(Tensor) The first input tensor of elementwise op"); + AddInput("Y", "(Tensor) The second input tensor of elementwise op"); + AddOutput("Out", "The output of elementwise op"); AddAttr("axis", - R"DOC( -When the shape(Y) does not equal the shape(X),Y will be broadcasted -to match the shape of X and axis should be dimension index Y in X - )DOC") + "(int, default -1) The starting dimension index " + "for broadcasting Y onto X") .SetDefault(-1) .EqualGreaterThan(-1); - - AddOutput("Out", "The output of elementwise op"); comment_ = R"DOC( -Limited elementwise {name} operator.The equation is: Out = {equation}. -1. The shape of Y should be same with X or -2. Y's shape is a subset of X. - Y will be broadcasted to match the shape of X and axis should be dimension index Y in X. - - example: - shape(X) = (2, 3, 4, 5), shape(Y) = (,) - shape(X) = (2, 3, 4, 5), shape(Y) = (5,) - shape(X) = (2, 3, 4, 5), shape(Y) = (4, 5) - shape(X) = (2, 3, 4, 5), shape(Y) = (3, 4), with axis=1 - shape(X) = (2, 3, 4, 5), shape(Y) = (2), with axis=0 +Limited Elementwise {name} Operator. + +The equation is: + +{equation} + +X is a tensor of any dimension and the dimensions of tensor Y must be smaller than +or equal to the dimensions of X. + +There are two cases for this operator: +1. The shape of Y is same with X; +2. The shape of Y is a subset of X. + +For case 2: +Y will be broadcasted to match the shape of X and axis should be +the starting dimension index for broadcasting Y onto X. + +example: + shape(X) = (2, 3, 4, 5), shape(Y) = (,) + shape(X) = (2, 3, 4, 5), shape(Y) = (5,) + shape(X) = (2, 3, 4, 5), shape(Y) = (4, 5) + shape(X) = (2, 3, 4, 5), shape(Y) = (3, 4), with axis=1 + shape(X) = (2, 3, 4, 5), shape(Y) = (2), with axis=0 Both the input X and Y can carry the LoD (Level of Details) information, -or not. But the output only shares the LoD with input X. +or not. But the output only shares the LoD information with input X. + )DOC"; AddComment(comment_); } diff --git a/paddle/operators/elementwise_sub_op.cc b/paddle/operators/elementwise_sub_op.cc index 3e4f98fdb35b148931a67d511fe41958eb523f99..39702dad0ee61de71ff0d54765e6f73de93cee9c 100644 --- a/paddle/operators/elementwise_sub_op.cc +++ b/paddle/operators/elementwise_sub_op.cc @@ -22,7 +22,7 @@ class ElementwiseSubOpMaker : public ElementwiseOpMaker { ElementwiseSubOpMaker(framework::OpProto* proto, framework::OpAttrChecker* op_checker) : ElementwiseOpMaker(proto, op_checker) { - SetComment("Sub", "Out = X - Y"); + SetComment("Sub", "$Out = X - Y$"); AddComment(comment_); } }; diff --git a/paddle/operators/feed_op.cc b/paddle/operators/feed_op.cc index 0e5b263eae904d97b61d41691b848e4fa2c17971..0dd84cbeaafbafd45132b0a0b744554ce7475411 100644 --- a/paddle/operators/feed_op.cc +++ b/paddle/operators/feed_op.cc @@ -59,8 +59,13 @@ class FeedOpInfoMaker : public framework::OpProtoAndCheckerMaker { : OpProtoAndCheckerMaker(proto, op_checker) { AddInput("X", "The input of feed op"); AddOutput("Out", "The output of feed op"); - AddComment("feed op, it should not be configured by users directly"); - AddAttr("col", "column of feed"); + AddAttr("col", "(int) The column of feed"); + AddComment(R"DOC( +Feed Operator. + +It should not be configured by users directly. + +)DOC"); } }; diff --git a/paddle/operators/fetch_op.cc b/paddle/operators/fetch_op.cc index f1086e3dc774a5e57f1abb5d4f91f859fc0e64aa..8108ae69dec4bafd1c04d5ab05eef6f467d4c6e8 100644 --- a/paddle/operators/fetch_op.cc +++ b/paddle/operators/fetch_op.cc @@ -66,8 +66,13 @@ class FetchOpInfoMaker : public framework::OpProtoAndCheckerMaker { : OpProtoAndCheckerMaker(proto, op_checker) { AddInput("X", "The input of fetch op"); AddOutput("Out", "The output of fetch op"); - AddComment("fetch op, it should not be configured by users directly"); - AddAttr("col", "column of fetch"); + AddAttr("col", "(int) The column of fetch"); + AddComment(R"DOC( +Fetch Operator. + +It should not be configured by users directly. + +)DOC"); } }; } // namespace operators diff --git a/paddle/operators/fill_constant_batch_size_like_op.cc b/paddle/operators/fill_constant_batch_size_like_op.cc index 0244adb42392c707d755e95c7abdebd826c219b4..3f02214f30f886c5a03ad438fd795d44a0b8dddc 100644 --- a/paddle/operators/fill_constant_batch_size_like_op.cc +++ b/paddle/operators/fill_constant_batch_size_like_op.cc @@ -70,11 +70,16 @@ class FillConstantBatchSizeLikeOpMaker "with the specified value"); AddAttr>("shape", "(vector) The shape of the output"); AddAttr("dim_idx", - "(int, default 0) the index of batch size dimension") + "(int, default 0) The index of batch size dimension") .SetDefault(0); AddAttr("value", "(float, default 0) The value to be filled") .SetDefault(0.0f); - AddComment(R"DOC(Fill up a variable with specified constant value.)DOC"); + AddComment(R"DOC( +FillConstantBatchSizeLike Operator. + +Fill up a variable with specified constant value. + +)DOC"); } }; } // namespace operators diff --git a/paddle/operators/fill_constant_op.cc b/paddle/operators/fill_constant_op.cc index 7a861b6cfc0fab312f4e5a7cce2fc28f923173d2..ee2219cd03313beae352c18adbe7e029fabbb6d3 100644 --- a/paddle/operators/fill_constant_op.cc +++ b/paddle/operators/fill_constant_op.cc @@ -54,7 +54,12 @@ class FillConstantOpMaker : public framework::OpProtoAndCheckerMaker { AddOutput("Out", "(Tensor) Tensor of specified shape will be filled " "with the specified value"); - AddComment(R"DOC(Fill up a variable with specified constant value.)DOC"); + AddComment(R"DOC( +FillConstantBatchSizeLike Operator. + +Fill up a variable with specified constant value. + +)DOC"); } }; } // namespace operators diff --git a/paddle/operators/fill_zeros_like_op.cc b/paddle/operators/fill_zeros_like_op.cc index ed529ac40aaf179b35a9ab32e11ed7dbbe9289ba..8ab39d4fb012b8fa3883f33e4d15be7918500354 100644 --- a/paddle/operators/fill_zeros_like_op.cc +++ b/paddle/operators/fill_zeros_like_op.cc @@ -37,11 +37,13 @@ class FillZerosLikeOpMaker : public framework::OpProtoAndCheckerMaker { framework::OpAttrChecker *op_checker) : framework::OpProtoAndCheckerMaker(proto, op_checker) { AddInput("X", "The input of fill-zeros-like op."); - AddOutput("Y", "The varibale will be filled up with zeros."); + AddOutput("Y", "The variable will be filled up with zeros."); AddComment(R"DOC( -Fill up a vriable with zeros. +FillZerosLike Operator. + +Fill up a variable with zeros. +The output will have the same size as the input. -The output will have the same size with input. )DOC"); } };