How can I do numpy advanced indexing in chainer?
See original GitHub issueI mean how to do things like this
>>> import numpy as np
>>> a = np.array([1, 2, 3, 4])
>>> b = np.array([True, False, False, True])
>>> c = np.array([2, 0, 1, 3])
>>> a[b]
array([1, 4])
>>> a[c]
array([3, 1, 2, 4])
I have tried F.get_item
but the slices
parameter was limited to be
int, slice, None or Ellipsis or tuple of them
not np.narray
.
So how can I do this?
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
chainerx.ndarray — Chainer 7.8.0 documentation
This class works similar to numpy.ndarray , except for some differences including the ... Currently, only basic indexing is supported not advanced indexing....
Read more >Advanced NumPy Array Indexing, Made Easy | by Andre Ye
To access a range of elements, specify the start index and the stop index. The result will include all elements up to stop...
Read more >python - numpy advanced indexing on multidimensional-array
Say x is a 3x3 numpy array that contains the following: import numpy as np x = np.array([[ 1., 2., ...
Read more >Indexing on ndarrays — NumPy v1.25.dev0 Manual
ndarrays can be indexed using the standard Python x[obj] syntax, where x is the array and obj the selection. There are different kinds...
Read more >Advanced indexing (numpy) not supported · Issue #711 - GitHub
It seems you want to fill 0 by boolean indexing. You can use copyto to do that. I found that the current implementation...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You are right.
__getitem__
does not support+=
operation.I would send a PR that supports
+=
in the near future. Thanks.This issue is closed as announced. Feel free to re-open it if needed.