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/11/01 15:48:56 UTC
[GitHub] dai-dao opened a new issue #8505: Advanced Indexing Workaround
dai-dao opened a new issue #8505: Advanced Indexing Workaround
URL: https://github.com/apache/incubator-mxnet/issues/8505
Hi, I'm aware that this issue is still being implemented, but I want to ask for a viable workaround if there's any. Here's what I want to do:
```
>>> from mxnet import nd
>>> a = nd.array([[1,2], [3, 4]])
>>> a
[[ 1. 2.]
[ 3. 4.]]
<NDArray 2x2 @cpu(0)>
>>>
>>> a[[0, 1], [0, 1]]
[ 1. 4.]
```
Now I want to assign values to these indexes:
```
>>> a[[0, 1], [0, 1]] = [5, 6]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/daidao/anaconda3/envs/rl/lib/python3.6/site-packages/mxnet/ndarray/ndarray.py", line 440, in __setitem__
str(slice_i), str(type(slice_i))))
ValueError: NDArray does not support slicing with key [0, 1] of type <class 'list'>.
```
and I got an error. Is there a way to work around this for the mean time? Thank you
----------------------------------------------------------------
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