You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by gi...@git.apache.org on 2017/08/23 16:58:04 UTC
[GitHub] eric-haibin-lin commented on a change in pull request #7577: Sparse operators for unary and binary elemwise NDArray operators.
eric-haibin-lin commented on a change in pull request #7577: Sparse operators for unary and binary elemwise NDArray operators.
URL: https://github.com/apache/incubator-mxnet/pull/7577#discussion_r134809711
##########
File path: src/operator/tensor/elemwise_unary_op.cc
##########
@@ -405,16 +472,17 @@ Example::
rsqrt([4,9,16]) = [0.5, 0.33333334, 0.25]
+The storage type of ``rsqrt`` output is always dense
+
)code" ADD_FILELINE)
-.set_attr<FCompute>("FCompute<cpu>", UnaryCompute<cpu, mshadow_op::reciprocal_square_root>)
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseIn{"_backward_rsqrt"});
-MXNET_OPERATOR_REGISTER_BINARY(_backward_rsqrt)
-.set_attr<FCompute>("FCompute<cpu>",
- BinaryCompute<cpu, unary_bwd<mshadow_op::reciprocal_square_root_grad> >);
+MXNET_OPERATOR_REGISTER_BINARY_LAUNCH_CPU_DR(_backward_rsqrt,
+ unary_bwd<mshadow_op::reciprocal_square_root_grad>);
// exp
-MXNET_OPERATOR_REGISTER_UNARY(exp)
+MXNET_OPERATOR_REGISTER_UNARY_COMPUTE_DR(exp, cpu, mshadow_op::exp)
Review comment:
I saw exp in the list of operators. This operator doesn't do anything special for sparse (except fallback to dense). Should we remove its `MXNET_ADD_SPARSE_OP_ALIAS` ?
Same for other operators registered with `MXNET_OPERATOR_REGISTER_UNARY_COMPUTE_DR` and `MXNET_OPERATOR_REGISTER_UNARY_COMPUTE_DR`
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services