You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/07/11 02:39:38 UTC

[GitHub] [incubator-mxnet] xidulu commented on a change in pull request #15495: [Numpy] Added operator logaddexp; added support for zero-size tensor in BinaryBroadcastBackwardUseIn

xidulu commented on a change in pull request #15495: [Numpy] Added operator logaddexp; added support for zero-size tensor in BinaryBroadcastBackwardUseIn
URL: https://github.com/apache/incubator-mxnet/pull/15495#discussion_r302343715
 
 

 ##########
 File path: src/operator/numpy/np_elemwise_broadcast_op.cc
 ##########
 @@ -186,6 +212,21 @@ MXNET_OPERATOR_REGISTER_NP_BINARY_SCALAR(_npi_power_scalar)
 .set_attr<FCompute>("FCompute<cpu>", BinaryScalarOp::Compute<cpu, mshadow_op::power>)
 .set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseIn{"_backward_power_scalar"});
 
+MXNET_OPERATOR_REGISTER_NP_BINARY_SCALAR(_npi_logaddexp_scalar)
+.set_attr<FCompute>("FCompute<cpu>", BinaryScalarOp::Compute<cpu, mshadow_op::logaddexp>)
+.set_attr<nnvm::FGradient>("Fgradient", ElemwiseGradUseIn{"_backward_logaddexp_scalar"});
+
+
+MXNET_OPERATOR_REGISTER_BINARY(_backward_logaddexp_scalar)
+.add_argument("scalar", "float", "scalar value")
+.set_attr_parser([](NodeAttrs *attrs) { attrs->parsed = std::stod(attrs->dict["scalar"]); })
+.set_attr<FCompute>("FCompute<cpu>", BinaryScalarOp::Backward<
+  cpu, mshadow_op::logadd_left>);
+
+
+
+
+
 
 Review comment:
   blank lines removed, thanks for reviewing

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services