hzfan commented on a change in pull request #17812: [numpy] FFI binary bitwise
ops
URL: https://github.com/apache/incubator-mxnet/pull/17812#discussion_r391414897
##########
File path: src/api/operator/numpy/np_elemwise_broadcast_op.cc
##########
@@ -36,4 +36,60 @@ MXNET_REGISTER_API("_npi.add")
UFuncHelper(args, ret, op, op_scalar, nullptr);
});
+MXNET_REGISTER_API("_npi.bitwise_or")
+.set_body([](runtime::MXNetArgs args, runtime::MXNetRetValue* ret) {
+ using namespace runtime;
+ const nnvm::Op* op = Op::Get("_npi_bitwise_or");
+ const nnvm::Op* op_scalar = Op::Get("_npi_bitwise_or_scalar");
+ UFuncHelper(args, ret, op, op_scalar, nullptr);
+});
+
+MXNET_REGISTER_API("_npi.bitwise_xor")
+.set_body([](runtime::MXNetArgs args, runtime::MXNetRetValue* ret) {
+ using namespace runtime;
+ const nnvm::Op* op = Op::Get("_npi_bitwise_xor");
+ const nnvm::Op* op_scalar = Op::Get("_npi_bitwise_xor_scalar");
+ UFuncHelper(args, ret, op, op_scalar, nullptr);
+});
+
+MXNET_REGISTER_API("_npi.bitwise_and")
+.set_body([](runtime::MXNetArgs args, runtime::MXNetRetValue* ret) {
+ using namespace runtime;
+ const nnvm::Op* op = Op::Get("_npi_bitwise_and");
+ const nnvm::Op* op_scalar = Op::Get("_npi_bitwise_and_scalar");
+ UFuncHelper(args, ret, op, op_scalar, nullptr);
+});
+
+MXNET_REGISTER_API("_npi.copysign")
+.set_body([](runtime::MXNetArgs args, runtime::MXNetRetValue* ret) {
+ using namespace runtime;
+ const nnvm::Op* op = Op::Get("_npi_copysign");
+ const nnvm::Op* op_scalar = Op::Get("_npi_copysign_scalar");
+ UFuncHelper(args, ret, op, op_scalar, nullptr);
Review comment:
copysign is not commutative. The last arg should not be `nullptr`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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