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 2019/10/25 05:09:17 UTC

[GitHub] [incubator-mxnet] sxjscience commented on a change in pull request #15905: [Numpy] Basic indexing in symbolic interface

sxjscience commented on a change in pull request #15905: [Numpy] Basic indexing in symbolic interface
URL: https://github.com/apache/incubator-mxnet/pull/15905#discussion_r338887850
 
 

 ##########
 File path: src/operator/numpy/np_matrix_op-inl.h
 ##########
 @@ -60,6 +62,34 @@ void NumpyTranspose(const nnvm::NodeAttrs& attrs,
   }
 }
 
+struct NumpyXReshapeParam : public dmlc::Parameter<NumpyXReshapeParam> {
+  mxnet::Tuple<int> newshape;
+  std::string order;
+  DMLC_DECLARE_PARAMETER(NumpyXReshapeParam) {
+      DMLC_DECLARE_FIELD(newshape)
+          .set_default(mxnet::Tuple<int>())
+          .describe("The new shape should be compatible with the original shape."
+                    " If an integer, then the result will be a 1-D array of that length."
+                    " One shape dimension can be -1. In this case, the value is inferred"
+                    " from the length of the array and remaining dimensions."
+                    " -2 to -6 are used for data manipulation"
+                    " -2 copy this dimension from the input to the output shape"
+                    " -3 will skip current dimension if and only if the current dim size is one"
+                    " -4 copy all remain of the input dimensions to the output shape"
+                    " -5 use the product of two consecutive dimensions of the input"
+                    " shape as the output"
+                    " -6 split one dimension of the input into two dimensions passed"
+                    " subsequent to -6 in the new shape");
 
 Review comment:
   I find that the reverse flag in the original `nd.reshape` will also be useful.
   
   Sometimes, I'd like to reshape (..., N * C) --> (..., N, C), and could not do so without the reverse option.

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