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 2018/12/11 03:17:48 UTC
[GitHub] XiaotaoChen commented on a change in pull request #13150: support
mkl log when dtype is fp32 or fp64
XiaotaoChen commented on a change in pull request #13150: support mkl log when dtype is fp32 or fp64
URL: https://github.com/apache/incubator-mxnet/pull/13150#discussion_r240461236
##########
File path: src/operator/tensor/elemwise_unary_op_basic.cc
##########
@@ -940,7 +940,7 @@ The storage type of ``exp`` output is always dense
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseOut{"_mul"});
// log
-MXNET_OPERATOR_REGISTER_UNARY_WITH_SPARSE_DR(log, cpu, mshadow_op::log)
+MXNET_OPERATOR_REGISTER_UNARY(log)
Review comment:
the defination of `MXNET_OPERATOR_REGISTER_UNARY_WITH_SPARSE_DR` in `elemwise_unary_op.h` is here:
```c++
#define MXNET_OPERATOR_REGISTER_UNARY_WITH_SPARSE_DR(__name$, __xpu$, __kernel$) \
MXNET_OPERATOR_REGISTER_UNARY(__name$) \
.set_attr<FCompute>("FCompute<" #__xpu$ ">", UnaryOp::Compute<__xpu$, __kernel$>)
```
it will set FCompute attribute to `UnaryOp::Compute` automatically. To call Our `LogCompute`, we replace it with below codes.
```c++
MXNET_OPERATOR_REGISTER_UNARY(log)
.set_attr<FCompute>("FCompute<cpu>", UnaryOp::LogCompute<cpu, mshadow_op::log>)
```
----------------------------------------------------------------
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