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/20 04:39:51 UTC

[GitHub] [incubator-mxnet] Tommliu commented on a change in pull request #17873: [Numpy] FFI: array_split, v/h/dsplit

Tommliu commented on a change in pull request #17873: [Numpy] FFI: array_split, v/h/dsplit
URL: https://github.com/apache/incubator-mxnet/pull/17873#discussion_r395436651
 
 

 ##########
 File path: src/api/operator/numpy/np_matrix_op.cc
 ##########
 @@ -142,4 +142,158 @@ MXNET_REGISTER_API("_npi.rot90")
   *ret = ndoutputs[0];
 });
 
+MXNET_REGISTER_API("_npi.array_split")
+.set_body([](runtime::MXNetArgs args, runtime::MXNetRetValue* ret) {
+  using namespace runtime;
+  static const nnvm::Op* op = Op::Get("_npi_array_split");
+  nnvm::NodeAttrs attrs;
+  op::SplitParam param;
+  param.axis = args[2].operator int();
+  param.squeeze_axis = false;
+  if (args[1].type_code() == kDLInt) {
+    param.indices = TShape(0, 0);
+    param.sections = args[1].operator int();
+    CHECK_GT(param.sections, 0)
 
 Review comment:
   **_array_split_** support such split which is different from **_split_**

----------------------------------------------------------------
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