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 2017/12/18 19:08:26 UTC
[GitHub] aidan-plenert-macdonald commented on issue #9117: argsort produces an ndarray which cannot be used for indexing an ndarray
aidan-plenert-macdonald commented on issue #9117: argsort produces an ndarray which cannot be used for indexing an ndarray
URL: https://github.com/apache/incubator-mxnet/issues/9117#issuecomment-352527405
What version of MXNet are you using? Works fine for me in version 1.0.0.
```python
$ pip list | grep mxnet
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
mxnet (1.0.0.post1)
dca90487275d:~ macaidan$ python
Python 3.6.3 (default, Oct 4 2017, 06:09:15)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from mxnet import nd
>>> import numpy as np
>>> X = nd.random_normal(shape=(10, 10))
>>> np.all(nd.argsort(X, axis=1).asnumpy().astype(int) == np.argsort(X.asnumpy(), axis=1))
True
>>> np.all(X[nd.argsort(X, axis=1)].asnumpy() == X.asnumpy()[np.argsort(X.asnumpy(), axis=1)])
True
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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