未验证 提交 29b2693a 编写于 作者: T Tao Luo 提交者: GitHub

Merge pull request #7445 from abhinavarora/api_doc_bug

Fix the documentation for elementwise op in fluid layers
...@@ -38,6 +38,16 @@ elementwise_add ...@@ -38,6 +38,16 @@ elementwise_add
.. autofunction:: paddle.v2.fluid.layers.elementwise_add .. autofunction:: paddle.v2.fluid.layers.elementwise_add
:noindex: :noindex:
elementwise_sub
---------------
.. autofunction:: paddle.v2.fluid.layers.elementwise_sub
:noindex:
elementwise_mul
---------------
.. autofunction:: paddle.v2.fluid.layers.elementwise_mul
:noindex:
elementwise_div elementwise_div
--------------- ---------------
.. autofunction:: paddle.v2.fluid.layers.elementwise_div .. autofunction:: paddle.v2.fluid.layers.elementwise_div
......
...@@ -21,7 +21,7 @@ class ElementwiseAddOpMaker : public ElementwiseOpMaker { ...@@ -21,7 +21,7 @@ class ElementwiseAddOpMaker : public ElementwiseOpMaker {
public: public:
ElementwiseAddOpMaker(OpProto* proto, OpAttrChecker* op_checker) ElementwiseAddOpMaker(OpProto* proto, OpAttrChecker* op_checker)
: ElementwiseOpMaker(proto, op_checker) { : ElementwiseOpMaker(proto, op_checker) {
SetComment("Add", "$Out = X + Y$"); SetComment("Add", "Out = X + Y");
AddComment(comment_); AddComment(comment_);
} }
}; };
......
...@@ -21,7 +21,7 @@ class ElementwiseDivOpMaker : public ElementwiseOpMaker { ...@@ -21,7 +21,7 @@ class ElementwiseDivOpMaker : public ElementwiseOpMaker {
public: public:
ElementwiseDivOpMaker(OpProto* proto, OpAttrChecker* op_checker) ElementwiseDivOpMaker(OpProto* proto, OpAttrChecker* op_checker)
: ElementwiseOpMaker(proto, op_checker) { : ElementwiseOpMaker(proto, op_checker) {
SetComment("Div", "$Out = X / Y$"); SetComment("Div", "Out = X / Y");
AddComment(comment_); AddComment(comment_);
} }
}; };
......
...@@ -22,7 +22,7 @@ class ElementwiseMulOpMaker : public ElementwiseOpMaker { ...@@ -22,7 +22,7 @@ class ElementwiseMulOpMaker : public ElementwiseOpMaker {
public: public:
ElementwiseMulOpMaker(OpProto* proto, OpAttrChecker* op_checker) ElementwiseMulOpMaker(OpProto* proto, OpAttrChecker* op_checker)
: ElementwiseOpMaker(proto, op_checker) { : ElementwiseOpMaker(proto, op_checker) {
SetComment("Mul", "$Out = X \\odot\\ Y$"); SetComment("Mul", "Out = X \\odot\\ Y");
AddComment(comment_); AddComment(comment_);
} }
}; };
......
...@@ -58,7 +58,8 @@ Limited Elementwise {name} Operator. ...@@ -58,7 +58,8 @@ Limited Elementwise {name} Operator.
The equation is: The equation is:
{equation} .. math::
{equation}
X is a tensor of any dimension and the dimensions of tensor Y must be smaller than X is a tensor of any dimension and the dimensions of tensor Y must be smaller than
or equal to the dimensions of X. or equal to the dimensions of X.
...@@ -71,15 +72,16 @@ For case 2: ...@@ -71,15 +72,16 @@ For case 2:
Y will be broadcasted to match the shape of X and axis should be Y will be broadcasted to match the shape of X and axis should be
the starting dimension index for broadcasting Y onto X. the starting dimension index for broadcasting Y onto X.
example: For example
shape(X) = (2, 3, 4, 5), shape(Y) = (,) .. code-block:: python
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, shape(X) = (2, 3, 4, 5), shape(Y) = (,)
or not. But the output only shares the LoD information with input X. 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
Either of the inputs X and Y or none can carry the LoD (Level of Details) information. However, the output only shares the LoD information with input X.
)DOC"; )DOC";
AddComment(comment_); AddComment(comment_);
......
...@@ -21,7 +21,7 @@ class ElementwiseSubOpMaker : public ElementwiseOpMaker { ...@@ -21,7 +21,7 @@ class ElementwiseSubOpMaker : public ElementwiseOpMaker {
public: public:
ElementwiseSubOpMaker(OpProto* proto, OpAttrChecker* op_checker) ElementwiseSubOpMaker(OpProto* proto, OpAttrChecker* op_checker)
: ElementwiseOpMaker(proto, op_checker) { : ElementwiseOpMaker(proto, op_checker) {
SetComment("Sub", "$Out = X - Y$"); SetComment("Sub", "Out = X - Y");
AddComment(comment_); AddComment(comment_);
} }
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册