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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to