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_r183918262
 
 

 ##########
 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]]
 
 Review comment:
   Why do the lines of input have different data types? Making all of them to 
be float is fine, please refer to examples of other existing ops.

----------------------------------------------------------------
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

Reply via email to