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/01/21 08:51:13 UTC

[GitHub] [incubator-mxnet] hanke580 opened a new pull request #17393: [Numpy] Add sort op

hanke580 opened a new pull request #17393: [Numpy] Add sort op
URL: https://github.com/apache/incubator-mxnet/pull/17393
 
 
   ## Description ##
   Add operator sort
   More compatible with numpy
   
   ## Checklist ##
   ### Essentials ###
   Please feel free to remove inapplicable items for your PR.
   - [ ] The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant [JIRA issue](https://issues.apache.org/jira/projects/MXNET/issues) created (except PRs with tiny changes)
   - [ ] Changes are complete (i.e. I finished coding on this PR)
   - [ ] All changes have test coverage:
   - Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
   - Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
   - Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
   - [ ] Code is well-documented: 
   - For user-facing API changes, API doc string has been updated. 
   - For new C++ functions in header files, their functionalities and arguments are documented. 
   - For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
   - Check the API doc at https://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
   - [ ] To the best of my knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change
   
   ### Changes ###
   - [ ] Feature1, tests, (and when applicable, API doc)
   - [ ] Feature2, tests, (and when applicable, API doc)
   
   ## Comments ##
   - If this change is a backward incompatible change, why must this change be made.
   - Interesting edge cases to note here
   

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

[GitHub] [incubator-mxnet] haojin2 commented on a change in pull request #17393: [Numpy] Add sort op

Posted by GitBox <gi...@apache.org>.
haojin2 commented on a change in pull request #17393: [Numpy] Add sort op
URL: https://github.com/apache/incubator-mxnet/pull/17393#discussion_r369886313
 
 

 ##########
 File path: python/mxnet/numpy/multiarray.py
 ##########
 @@ -4635,6 +4635,47 @@ def argsort(a, axis=-1, kind=None, order=None):
     return _mx_nd_np.argsort(a, axis=axis, kind=kind, order=order)
 
 
+@set_module('mxnet.numpy')
+def sort(a, axis=-1, kind=None, order=None):
+    """
+    Return a sorted copy of an array.
+    Parameters
+    ----------
+    a : ndarray
+        Array to be sorted.
+    axis : int or None, optional
+        Axis along which to sort.  The default is -1 (the last axis). If None,
+        the flattened array is used.
+    kind : string, optional
+        This argument can take any string, but it does not have any effect on the
+        final result.
+    order : str or list of str, optional
+        Not supported yet, will raise NotImplementedError if not None.
+    Returns
+    -------
+    sorted_array : ndarray
+        Array of the same type and shape as `a`.
+
+    Notes
+    -----
+    This operator does not support different sorting algorithms.
+
+    --------
 
 Review comment:
   delete this line.

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

[GitHub] [incubator-mxnet] reminisce commented on a change in pull request #17393: [Numpy] Add sort op

Posted by GitBox <gi...@apache.org>.
reminisce commented on a change in pull request #17393: [Numpy] Add sort op
URL: https://github.com/apache/incubator-mxnet/pull/17393#discussion_r369287835
 
 

 ##########
 File path: python/mxnet/numpy/multiarray.py
 ##########
 @@ -4635,6 +4635,47 @@ def argsort(a, axis=-1, kind=None, order=None):
     return _mx_nd_np.argsort(a, axis=axis, kind=kind, order=order)
 
 
+@set_module('mxnet.numpy')
+def sort(a, axis=-1, kind=None, order=None):
+    """
+    Return a sorted copy of an array.
+    Parameters
+    ----------
+    a : ndarray
+        Array to be sorted.
+    axis : int or None, optional
+        Axis along which to sort.  The default is -1 (the last axis). If None,
+        the flattened array is used.
+    kind : string, optional
+        This argument can take any string, but it does not have any effect on the
+        final result.
+    order : str or list of str, optional
+        Not supported yet, will raise NotImplementedError if not None.
 
 Review comment:
   Blank line.

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

[GitHub] [incubator-mxnet] reminisce commented on a change in pull request #17393: [Numpy] Add sort op

Posted by GitBox <gi...@apache.org>.
reminisce commented on a change in pull request #17393: [Numpy] Add sort op
URL: https://github.com/apache/incubator-mxnet/pull/17393#discussion_r369288017
 
 

 ##########
 File path: python/mxnet/symbol/numpy/_symbol.py
 ##########
 @@ -1624,6 +1624,34 @@ def argsort(a, axis=-1, kind=None, order=None):
     return _npi.argsort(data=a, axis=axis, is_ascend=True, dtype='int64')
 
 
+@set_module('mxnet.symbol.numpy')
+def sort(a, axis=-1, kind=None, order=None):
+    """
+    Return a sorted copy of an array.
 
 Review comment:
   Blank line.

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

[GitHub] [incubator-mxnet] haojin2 commented on a change in pull request #17393: [Numpy] Add sort op

Posted by GitBox <gi...@apache.org>.
haojin2 commented on a change in pull request #17393: [Numpy] Add sort op
URL: https://github.com/apache/incubator-mxnet/pull/17393#discussion_r369886193
 
 

 ##########
 File path: python/mxnet/ndarray/numpy/_op.py
 ##########
 @@ -1223,6 +1224,49 @@ def argsort(a, axis=-1, kind=None, order=None):
     return _npi.argsort(data=a, axis=axis, is_ascend=True, dtype='int64')
 
 
+@set_module('mxnet.ndarray.numpy')
+def sort(a, axis=-1, kind=None, order=None):
+    """
+    Return a sorted copy of an array.
+    Parameters
+    ----------
+    a : ndarray
+        Array to be sorted.
+    axis : int or None, optional
+        Axis along which to sort.  The default is -1 (the last axis). If None,
+        the flattened array is used.
+    kind : string, optional
+        This argument can take any string, but it does not have any effect on the
+        final result.
+    order : str or list of str, optional
+        Not supported yet, will raise NotImplementedError if not None.
 
 Review comment:
   extra blank line below this line.

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

[GitHub] [incubator-mxnet] haojin2 merged pull request #17393: [Numpy] Add sort op

Posted by GitBox <gi...@apache.org>.
haojin2 merged pull request #17393: [Numpy] Add sort op
URL: https://github.com/apache/incubator-mxnet/pull/17393
 
 
   

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

[GitHub] [incubator-mxnet] reminisce commented on a change in pull request #17393: [Numpy] Add sort op

Posted by GitBox <gi...@apache.org>.
reminisce commented on a change in pull request #17393: [Numpy] Add sort op
URL: https://github.com/apache/incubator-mxnet/pull/17393#discussion_r369287619
 
 

 ##########
 File path: python/mxnet/ndarray/numpy/_op.py
 ##########
 @@ -1223,6 +1224,49 @@ def argsort(a, axis=-1, kind=None, order=None):
     return _npi.argsort(data=a, axis=axis, is_ascend=True, dtype='int64')
 
 
+@set_module('mxnet.ndarray.numpy')
+def sort(a, axis=-1, kind=None, order=None):
+    """
+    Return a sorted copy of an array.
 
 Review comment:
   Blank line.

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

[GitHub] [incubator-mxnet] reminisce commented on a change in pull request #17393: [Numpy] Add sort op

Posted by GitBox <gi...@apache.org>.
reminisce commented on a change in pull request #17393: [Numpy] Add sort op
URL: https://github.com/apache/incubator-mxnet/pull/17393#discussion_r369287804
 
 

 ##########
 File path: python/mxnet/numpy/multiarray.py
 ##########
 @@ -4635,6 +4635,47 @@ def argsort(a, axis=-1, kind=None, order=None):
     return _mx_nd_np.argsort(a, axis=axis, kind=kind, order=order)
 
 
+@set_module('mxnet.numpy')
+def sort(a, axis=-1, kind=None, order=None):
+    """
+    Return a sorted copy of an array.
 
 Review comment:
   Blank line.

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

[GitHub] [incubator-mxnet] haojin2 commented on a change in pull request #17393: [Numpy] Add sort op

Posted by GitBox <gi...@apache.org>.
haojin2 commented on a change in pull request #17393: [Numpy] Add sort op
URL: https://github.com/apache/incubator-mxnet/pull/17393#discussion_r369886145
 
 

 ##########
 File path: python/mxnet/ndarray/numpy/_op.py
 ##########
 @@ -1223,6 +1224,49 @@ def argsort(a, axis=-1, kind=None, order=None):
     return _npi.argsort(data=a, axis=axis, is_ascend=True, dtype='int64')
 
 
+@set_module('mxnet.ndarray.numpy')
+def sort(a, axis=-1, kind=None, order=None):
+    """
+    Return a sorted copy of an array.
 
 Review comment:
   extra blank line below this line.

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

[GitHub] [incubator-mxnet] reminisce commented on a change in pull request #17393: [Numpy] Add sort op

Posted by GitBox <gi...@apache.org>.
reminisce commented on a change in pull request #17393: [Numpy] Add sort op
URL: https://github.com/apache/incubator-mxnet/pull/17393#discussion_r369288037
 
 

 ##########
 File path: python/mxnet/symbol/numpy/_symbol.py
 ##########
 @@ -1624,6 +1624,34 @@ def argsort(a, axis=-1, kind=None, order=None):
     return _npi.argsort(data=a, axis=axis, is_ascend=True, dtype='int64')
 
 
+@set_module('mxnet.symbol.numpy')
+def sort(a, axis=-1, kind=None, order=None):
+    """
+    Return a sorted copy of an array.
+    Parameters
+    ----------
+    a : _Symbol
+        Array to be sorted.
+    axis : int or None, optional
+        Axis along which to sort.  The default is -1 (the last axis). If None,
+        the flattened array is used.
+    kind : string, optional
+        This argument can take any string, but it does not have any effect on the
+        final result.
+    order : str or list of str, optional
+        Not supported yet, will raise NotImplementedError if not None.
 
 Review comment:
   Blank line.

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

[GitHub] [incubator-mxnet] reminisce commented on a change in pull request #17393: [Numpy] Add sort op

Posted by GitBox <gi...@apache.org>.
reminisce commented on a change in pull request #17393: [Numpy] Add sort op
URL: https://github.com/apache/incubator-mxnet/pull/17393#discussion_r369287688
 
 

 ##########
 File path: python/mxnet/ndarray/numpy/_op.py
 ##########
 @@ -1223,6 +1224,49 @@ def argsort(a, axis=-1, kind=None, order=None):
     return _npi.argsort(data=a, axis=axis, is_ascend=True, dtype='int64')
 
 
+@set_module('mxnet.ndarray.numpy')
+def sort(a, axis=-1, kind=None, order=None):
+    """
+    Return a sorted copy of an array.
+    Parameters
+    ----------
+    a : ndarray
+        Array to be sorted.
+    axis : int or None, optional
+        Axis along which to sort.  The default is -1 (the last axis). If None,
+        the flattened array is used.
+    kind : string, optional
+        This argument can take any string, but it does not have any effect on the
+        final result.
+    order : str or list of str, optional
+        Not supported yet, will raise NotImplementedError if not None.
 
 Review comment:
   Blank line.

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

[GitHub] [incubator-mxnet] haojin2 commented on a change in pull request #17393: [Numpy] Add sort op

Posted by GitBox <gi...@apache.org>.
haojin2 commented on a change in pull request #17393: [Numpy] Add sort op
URL: https://github.com/apache/incubator-mxnet/pull/17393#discussion_r369886238
 
 

 ##########
 File path: python/mxnet/ndarray/numpy/_op.py
 ##########
 @@ -1223,6 +1224,49 @@ def argsort(a, axis=-1, kind=None, order=None):
     return _npi.argsort(data=a, axis=axis, is_ascend=True, dtype='int64')
 
 
+@set_module('mxnet.ndarray.numpy')
+def sort(a, axis=-1, kind=None, order=None):
+    """
+    Return a sorted copy of an array.
+    Parameters
+    ----------
+    a : ndarray
+        Array to be sorted.
+    axis : int or None, optional
+        Axis along which to sort.  The default is -1 (the last axis). If None,
+        the flattened array is used.
+    kind : string, optional
+        This argument can take any string, but it does not have any effect on the
+        final result.
+    order : str or list of str, optional
+        Not supported yet, will raise NotImplementedError if not None.
+    Returns
+    -------
+    sorted_array : ndarray
+        Array of the same type and shape as `a`.
+
+    Notes
+    -----
+    This operator does not support different sorting algorithms.
+
+    --------
 
 Review comment:
   delete this line.

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