[GitHub] [incubator-mxnet] haojin2 commented on a change in pull request #15358: Numpy hsplit
haojin2 commented on a change in pull request #15358: Numpy hsplit URL: https://github.com/apache/incubator-mxnet/pull/15358#discussion_r314457231 ## File path: src/operator/numpy/np_matrix_op.cc ## @@ -464,5 +464,44 @@ NNVM_REGISTER_OP(_np_squeeze) .add_argument("a", "NDArray-or-Symbol[]", "data to squeeze") .add_arguments(SqueezeParam::__FIELDS__()); +NNVM_REGISTER_OP(_npi_hsplit) +.add_alias("_npi_hsplit") +.describe(R"code(Splits an array along a particular axis= 1 into multiple sub-arrays. + +`squeeze_axis=True` removes the axis with length 1 from the shapes of the output arrays. Review comment: No need for `.describe()` here as this is an internal operator. 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
[GitHub] [incubator-mxnet] haojin2 commented on a change in pull request #15358: Numpy hsplit
haojin2 commented on a change in pull request #15358: Numpy hsplit URL: https://github.com/apache/incubator-mxnet/pull/15358#discussion_r314457021 ## File path: src/operator/numpy/np_matrix_op.cc ## @@ -464,5 +464,44 @@ NNVM_REGISTER_OP(_np_squeeze) .add_argument("a", "NDArray-or-Symbol[]", "data to squeeze") .add_arguments(SqueezeParam::__FIELDS__()); +NNVM_REGISTER_OP(_npi_hsplit) +.add_alias("_npi_hsplit") Review comment: If you already registered it as `_npi_split` then you do not need an extra `_npi_split` alias 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
[GitHub] [incubator-mxnet] haojin2 commented on a change in pull request #15358: Numpy hsplit
haojin2 commented on a change in pull request #15358: Numpy hsplit URL: https://github.com/apache/incubator-mxnet/pull/15358#discussion_r314457021 ## File path: src/operator/numpy/np_matrix_op.cc ## @@ -464,5 +464,44 @@ NNVM_REGISTER_OP(_np_squeeze) .add_argument("a", "NDArray-or-Symbol[]", "data to squeeze") .add_arguments(SqueezeParam::__FIELDS__()); +NNVM_REGISTER_OP(_npi_hsplit) +.add_alias("_npi_hsplit") Review comment: If you already registered it as `_npi_hsplit` then you do not need an extra `_npi_hsplit` alias 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
[GitHub] [incubator-mxnet] haojin2 commented on a change in pull request #15358: Numpy hsplit
haojin2 commented on a change in pull request #15358: Numpy hsplit URL: https://github.com/apache/incubator-mxnet/pull/15358#discussion_r314456576 ## File path: src/operator/numpy/np_matrix_op-inl.h ## @@ -59,6 +59,222 @@ void NumpyTranspose(const nnvm::NodeAttrs& attrs, } } Review comment: Seems like you're re-using most of the existing [SplitOpForward](https://github.com/apache/incubator-mxnet/blob/master/src/operator/tensor/matrix_op-inl.h#L2762-L2823) and [SplitOpBackward](https://github.com/apache/incubator-mxnet/blob/master/src/operator/tensor/matrix_op-inl.h#L2825-L2887), maybe you could refactor the existing code to expose common SplitOpForwardImpl and SplitOpBackwardImpl and call these functions from here instead of copying the code over. 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