-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refine the doc for mul_op and fully connected layer. #6792
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor grammatical changes. Make sure to follow the comments syntax in the naming convention for inputs and outputs.
paddle/operators/mul_op.cc
Outdated
AddInput("X", "The first input of mul op"); | ||
AddInput("Y", "The second input of mul op"); | ||
AddOutput("Out", "The output of mul op"); | ||
AddInput("X", "The first input tensor of the mul op."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should The first input tensor of mul op.
There should not be a the
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
paddle/operators/mul_op.cc
Outdated
AddInput("Y", "The second input of mul op"); | ||
AddOutput("Out", "The output of mul op"); | ||
AddInput("X", "The first input tensor of the mul op."); | ||
AddInput("Y", "The second input tensor of the mul op."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
paddle/operators/mul_op.cc
Outdated
AddOutput("Out", "The output of mul op"); | ||
AddInput("X", "The first input tensor of the mul op."); | ||
AddInput("Y", "The second input tensor of the mul op."); | ||
AddOutput("Out", "The output tensor of the mul op."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -73,30 +73,42 @@ class MulOpMaker : public framework::OpProtoAndCheckerMaker { | |||
public: | |||
MulOpMaker(OpProto* proto, OpAttrChecker* op_checker) | |||
: OpProtoAndCheckerMaker(proto, op_checker) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also be following the comment syntax as given in the naming convention -> https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/operators/name_convention.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I check the name convention in this doc https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/operators/op_documentation/name_convention.md, the current input names and the output name do not violate our name convention. So I only fix the comment style suggested in this doc. If I miss still something, please point it out. Thank you.
paddle/operators/mul_op.cc
Outdated
flattened to form the first dimension of the final matrix (height | ||
of the matrix), and the rest `rank(X) - num_col_dims` dimensions | ||
are flattened to form the second dimension of the final matrix ( | ||
width of the matrix). As a result, height of the flattened matrix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
height
-> the height
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
paddle/operators/mul_op.cc
Outdated
are flattened to form the second dimension of the final matrix ( | ||
width of the matrix). As a result, height of the flattened matrix | ||
is equal to the product of `X`'s first `x_num_col_dims` dimensions' | ||
sizes, and width of the flattened matrix is equal to the product |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
width
-> the width
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
paddle/operators/mul_op.cc
Outdated
sizes, and width of the flattened matrix is equal to the product | ||
of `X`'s last `rank(x) - num_col_dims` dimensions' size. | ||
For example, suppose `X` is a 6-dimensional tensor with the shape | ||
[2, 3, 4, 5, 6], and `x_num_col_dims` = 3. Then, the flattened |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then
-> Thus
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
paddle/operators/mul_op.cc
Outdated
in that case, tensors will be reshaped to a matrix. Just like input `X`. | ||
R"DOC(The mul_op can take tensors with more than two dimensions as its | ||
inputs. If the input `Y` is a tensor with more than two | ||
dimensions, `Y` will be flatten into a two-dimensional matrix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flatten
-> flattened
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
python/paddle/v2/fluid/layers/nn.py
Outdated
tensor will first be flattened into a 2-dimensional | ||
matrix. The parameter `num_flatten_dims` determines | ||
how the input tensor is flattened: the first | ||
`num_flatten_dims` dimensions will be flatten to form |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flatten
-> flattened
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
follow comments.
paddle/operators/mul_op.cc
Outdated
AddInput("X", "The first input of mul op"); | ||
AddInput("Y", "The second input of mul op"); | ||
AddOutput("Out", "The output of mul op"); | ||
AddInput("X", "The first input tensor of the mul op."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
paddle/operators/mul_op.cc
Outdated
AddInput("Y", "The second input of mul op"); | ||
AddOutput("Out", "The output of mul op"); | ||
AddInput("X", "The first input tensor of the mul op."); | ||
AddInput("Y", "The second input tensor of the mul op."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
paddle/operators/mul_op.cc
Outdated
AddOutput("Out", "The output of mul op"); | ||
AddInput("X", "The first input tensor of the mul op."); | ||
AddInput("Y", "The second input tensor of the mul op."); | ||
AddOutput("Out", "The output tensor of the mul op."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
paddle/operators/mul_op.cc
Outdated
flattened to form the first dimension of the final matrix (height | ||
of the matrix), and the rest `rank(X) - num_col_dims` dimensions | ||
are flattened to form the second dimension of the final matrix ( | ||
width of the matrix). As a result, height of the flattened matrix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
paddle/operators/mul_op.cc
Outdated
are flattened to form the second dimension of the final matrix ( | ||
width of the matrix). As a result, height of the flattened matrix | ||
is equal to the product of `X`'s first `x_num_col_dims` dimensions' | ||
sizes, and width of the flattened matrix is equal to the product |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
paddle/operators/mul_op.cc
Outdated
in that case, tensors will be reshaped to a matrix. Just like input `X`. | ||
R"DOC(The mul_op can take tensors with more than two dimensions as its | ||
inputs. If the input `Y` is a tensor with more than two | ||
dimensions, `Y` will be flatten into a two-dimensional matrix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
paddle/operators/mul_op.cc
Outdated
sizes, and width of the flattened matrix is equal to the product | ||
of `X`'s last `rank(x) - num_col_dims` dimensions' size. | ||
For example, suppose `X` is a 6-dimensional tensor with the shape | ||
[2, 3, 4, 5, 6], and `x_num_col_dims` = 3. Then, the flattened |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -73,30 +73,42 @@ class MulOpMaker : public framework::OpProtoAndCheckerMaker { | |||
public: | |||
MulOpMaker(OpProto* proto, OpAttrChecker* op_checker) | |||
: OpProtoAndCheckerMaker(proto, op_checker) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I check the name convention in this doc https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/operators/op_documentation/name_convention.md, the current input names and the output name do not violate our name convention. So I only fix the comment style suggested in this doc. If I miss still something, please point it out. Thank you.
LGTM! |
fixes #6785 #6835