-
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
Fix equation in logical or op #6315
Conversation
@@ -139,15 +139,16 @@ class LogicalOp : public framework::OperatorWithKernel { | |||
::paddle::operators::UnaryLogicalOpInferShape<_##op_type##Comment>, \ | |||
::paddle::framework::EmptyGradOpMaker); | |||
|
|||
REGISTER_BINARY_LOGICAL_OP(logical_and, "Out = X && Y"); | |||
REGISTER_BINARY_LOGICAL_OP(logical_and, "$$Out = X \\&\\& Y$$"); |
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.
What is the reason of putting \\
before &
? I think \\
will serve as a line breaker. \&
will escape and display &
correctly.
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 is because it is a C++ string. Since \
is an escape character in C++ strings, we need to write \\
if we want a \
to be a part of the string parsed by latex.
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 see. Thanks for the clarification.
REGISTER_UNARY_LOGICAL_KERNEL(logical_not, CPU, | ||
paddle::operators::LogicalNotFunctor); | ||
REGISTER_BINARY_LOGICAL_OP(logical_xor, "Out = (X || Y) && !(X && Y)"); | ||
REGISTER_BINARY_LOGICAL_OP(logical_xor, | ||
"$$Out = (X || Y) \\, \\&\\& \\, !(X \\&\\& Y)$$"); |
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 here. Also why adding \\,
in between?
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.
LGTM!
Fixes #6310