haojin2 commented on a change in pull request #15277: [Numpy] Numpy argsort
URL: https://github.com/apache/incubator-mxnet/pull/15277#discussion_r296126980
##########
File path: python/mxnet/symbol/numpy/_symbol.py
##########
@@ -1138,6 +1143,33 @@ def argmax(a, axis=None, out=None):
return _npi.argmax(a, axis=axis, keepdims=False, out=out)
+@set_module('mxnet.symbol.numpy')
+def argsort(a, axis=-1, kind='quicksort', order=None):
+ """
+ Returns the indices that would sort an input array along the given axis.
+ This function performs sorting along the given axis and returns an array
+ of indices having same shape as an input array that index data in sorted
order.
+
+ Parameters
+ ----------
+ a : ndarray
+ Input array
+ axis : int, optional
+ The axis along which to sort teh input tensor.
+ If not given, the last, dimension -1 will be used by default.
+
+ Returns
+ -------
+ output : ndarray of indicies that sort input array along the specified axis
+ Examples:
+ """
+ if kind != 'quicksort':
+ raise AttributeError('mxnet.numpy.argsort does not support other
sorting methods')
+ if order is not None:
+ raise AttributeError('mxnet.numpy.argsort does not support sorting
with fields ordering')
+ return _npi.argsort(a, axis)
+
+
Review comment:
your sanity check fails 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:
[email protected]
With regards,
Apache Git Services