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/04/22 02:04:32 UTC
[GitHub] [incubator-mxnet] sxjscience opened a new issue #18132: [Numpy] np.split will trigger an error
sxjscience opened a new issue #18132:
URL: https://github.com/apache/incubator-mxnet/issues/18132
Minimal reproducible example:
```python
import mxnet as mx
mx.npx.set_np()
a = mx.np.ones((10, 10, 3))
mx.np.split(a, 3, axis=-1)
```
Error message
```
MXNetError Traceback (most recent call last)
<ipython-input-20-31fd4ac7e489> in <module>
----> 1 mx.np.split(a, 3, axis=-1)
~/mxnet/python/mxnet/numpy/multiarray.py in split(ary, indices_or_sections, axis)
5835 [array([0., 1., 2.]), array([3., 4.]), array([5.]), array([6., 7.]), array([])]
5836 """
-> 5837 return _mx_nd_np.split(ary, indices_or_sections, axis=axis)
5838
5839
~/mxnet/python/mxnet/ndarray/numpy/_op.py in split(ary, indices_or_sections, axis)
3905 if isinstance(indices_or_sections, set):
3906 indices_or_sections = list(indices_or_sections)
-> 3907 return list(_api_internal.split(ary, indices_or_sections, axis))
3908 # pylint: enable=redefined-outer-name
3909
~/mxnet/python/mxnet/_ffi/_ctypes/function.py in __call__(self, *args)
113 self.handle, values, tcodes, ctypes.c_int(num_args),
114 ctypes.byref(ret_val), ctypes.byref(ret_tcode)) != 0:
--> 115 raise get_last_ffi_error()
116 _ = temp_args
117 _ = args
MXNetError: Traceback (most recent call last):
File "../include/mxnet/./tuple.h", line 245
MXNetError: Check failed: i >= 0 && i < ndim(): index = -1 must be in range [0, 3)
```
Just use numpy won't have any error.
```
import numpy as np
a = np.ones((10, 10, 3))
np.split(a, 3, axis=-1)
```
----------------------------------------------------------------
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
[GitHub] [incubator-mxnet] reminisce commented on issue #18132: [Numpy] np.split will trigger an error
Posted by GitBox <gi...@apache.org>.
reminisce commented on issue #18132:
URL: https://github.com/apache/incubator-mxnet/issues/18132#issuecomment-617564312
The `axis` should have been canonicalized in backend. @hzfan Can you get it fixed?
https://github.com/apache/incubator-mxnet/blob/6a809aaca12ea4dd31d1c2d8121b881b25eb916b/src/api/operator/numpy/np_matrix_op.cc#L142-L149
----------------------------------------------------------------
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
[GitHub] [incubator-mxnet] hgt312 commented on issue #18132: [Numpy] np.split will trigger an error
Posted by GitBox <gi...@apache.org>.
hgt312 commented on issue #18132:
URL: https://github.com/apache/incubator-mxnet/issues/18132#issuecomment-617568536
Seems these checks in ffi is redundant? The logic is already in `FCompute` function.
----------------------------------------------------------------
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
[GitHub] [incubator-mxnet] hzfan commented on issue #18132: [Numpy] np.split will trigger an error
Posted by GitBox <gi...@apache.org>.
hzfan commented on issue #18132:
URL: https://github.com/apache/incubator-mxnet/issues/18132#issuecomment-617565831
@reminisce I will fix it. Thanks for the deep dive.
----------------------------------------------------------------
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