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 2020/03/17 02:02:04 UTC
[GitHub] [incubator-mxnet] hzfan commented on a change in pull request
#17831: [numpy] add new ffi for column_stack and hstack
hzfan commented on a change in pull request #17831: [numpy] add new ffi for column_stack and hstack
URL: https://github.com/apache/incubator-mxnet/pull/17831#discussion_r393402306
##########
File path: src/api/operator/numpy/np_matrix_op.cc
##########
@@ -46,4 +47,46 @@ MXNET_REGISTER_API("_npi.expand_dims")
*ret = ndoutputs[0];
});
+MXNET_REGISTER_API("_npi.column_stack")
+.set_body([](runtime::MXNetArgs args, runtime::MXNetRetValue* ret) {
+ using namespace runtime;
+ const nnvm::Op* op = Op::Get("_npi_column_stack");
+ nnvm::NodeAttrs attrs;
+ op::NumpyColumnStackParam param;
+ param.num_args = args.size();
+
+ attrs.parsed = param;
+ attrs.op = op;
+ SetAttrDict<op::NumpyColumnStackParam>(&attrs);
+ int num_outputs = 0;
+ NDArray** inputs = new NDArray*[param.num_args];
Review comment:
Please avoid `new`. What about `vector<NDArray*>`?
----------------------------------------------------------------
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