haojin2 commented on a change in pull request #10679: [MXNET-347] Logical
Operators AND, XOR, OR
URL: https://github.com/apache/incubator-mxnet/pull/10679#discussion_r183918304
##########
File path: src/operator/tensor/elemwise_binary_broadcast_op_logic.cc
##########
@@ -137,5 +137,59 @@ Example::
.set_attr<FCompute>("FCompute<cpu>", BinaryBroadcastCompute<cpu,
mshadow_op::le>)
.set_attr<nnvm::FGradient>("FGradient", MakeZeroGradNodes);
+MXNET_OPERATOR_REGISTER_BINARY_BROADCAST(broadcast_logical_and)
+.describe(R"code(Returns the result of element-wise **logical and** with
broadcasting.
+
+Example::
+
+ x = [[ 1., 1., 1.],
+ [ 1., 1., 1.]]
+
+ y = [[ 0.],
+ [ 1.]]
+
+ broadcast_logical_and(x, y) = [[ 0., 0., 0.],
+ [ 1., 1., 1.]]
+
+)code" ADD_FILELINE)
+.set_attr<FCompute>("FCompute<cpu>", BinaryBroadcastCompute<cpu,
mshadow_op::logical_and>)
+.set_attr<nnvm::FGradient>("FGradient", MakeZeroGradNodes);
+
+MXNET_OPERATOR_REGISTER_BINARY_BROADCAST(broadcast_logical_or)
+.describe(R"code(Returns the result of element-wise **logical or** with
broadcasting.
+
+Example::
+
+ x = [[1 , 2, 0],
+ [0.5, -2.3, 0.0]]
+
+ y = [[2.0],
+ [0]]
+
+ broadcast_logical_or(x, y) = [[1. 1. 1.]
+ [1. 1. 0.]]
+
+)code" ADD_FILELINE)
+.set_attr<FCompute>("FCompute<cpu>", BinaryBroadcastCompute<cpu,
mshadow_op::logical_or>)
+.set_attr<nnvm::FGradient>("FGradient", MakeZeroGradNodes);
+
+MXNET_OPERATOR_REGISTER_BINARY_BROADCAST(broadcast_logical_xor)
+.describe(R"code(Returns the result of element-wise **logical xor** with
broadcasting.
+
+Example::
+
+ x = [[1 , 2, 0],
+ [0.5, -2.3, 0.0]]
+
+ y = [[2.0],
+ [0]]
+
+ broadcast_logical_xor(x, y) = [[0. 0. 1.]
+ [1. 1. 0.]]
Review comment:
Same here, please align the lines.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services