reminisce commented on a change in pull request #7244: Operator add_n for row sparse ndarrays URL: https://github.com/apache/incubator-mxnet/pull/7244#discussion_r130232814
########## File path: src/operator/tensor/elemwise_unary_op.h ########## @@ -105,6 +105,38 @@ void IdentityComputeRspRspImpl(const nnvm::NodeAttrs& attrs, } template<typename xpu> +void IdentityComputeEx(const nnvm::NodeAttrs& attrs, + const OpContext& ctx, + const std::vector<NDArray>& inputs, + const std::vector<OpReqType>& req, + const std::vector<NDArray>& outputs) { + CHECK_EQ(inputs.size(), 1U); + CHECK_EQ(outputs.size(), 1U); + CHECK_EQ(req.size(), 1U); + const auto in_stype = inputs[0].storage_type(); + const auto out_stype = outputs[0].storage_type(); + mshadow::Stream<xpu> *s = ctx.get_stream<xpu>(); + if (in_stype == out_stype) { + if (in_stype == kDefaultStorage) { // dense ndarray + IdentityCompute<xpu>(attrs, ctx, {inputs[0].data()}, req, {outputs[0].data()}); + } else { // sparse ndarray Review comment: Done. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services