leezu opened a new issue #11552: broadcast_reduce_op does check for negative axes URL: https://github.com/apache/incubator-mxnet/issues/11552 ## Description Consider ```python import mxnet as mx a = mx.nd.ones((1, 1, 1, 1, 1, 1, 1)) print(mx.nd.broadcast_axes(a, -4, 10).shape) ``` Results in ``` Traceback (most recent call last): File "mxnet_test.py", line 3, in <module> print(mx.nd.broadcast_axes(a, -4, 10).shape) File "<string>", line 56, in broadcast_axes File "/Users/lllausen/anaconda3/envs/py36/lib/python3.6/site-packages/mxnet/_ctypes/ndarray.py", line 92, in _imperative_invoke ctypes.byref(out_stypes))) File "/Users/lllausen/anaconda3/envs/py36/lib/python3.6/site-packages/mxnet/base.py", line 210, in check_call raise MXNetError(py_str(_LIB.MXGetLastError())) mxnet.base.MXNetError: [00:40:51] src/operator/tensor/./broadcast_reduce_op.h:306: Check failed: oshape[param.axis[i]] == 1U (2332991486559351923 vs. 1) Broadcasting axis must have size 1 Stack trace returned 8 entries: [bt] (0) 0 libmxnet.so 0x000000011000c3b4 libmxnet.so + 21428 [bt] (1) 1 libmxnet.so 0x000000011000c16f libmxnet.so + 20847 [bt] (2) 2 libmxnet.so 0x0000000110359431 libmxnet.so + 3482673 [bt] (3) 3 libmxnet.so 0x000000011113d47a MXNDListFree + 497978 [bt] (4) 4 libmxnet.so 0x000000011113c099 MXNDListFree + 492889 [bt] (5) 5 libmxnet.so 0x000000011109d40a MXCustomFunctionRecord + 20666 [bt] (6) 6 libmxnet.so 0x000000011109e4b0 MXImperativeInvokeEx + 176 [bt] (7) 7 libffi.6.dylib 0x000000010f0f7884 ffi_call_unix64 + 76 ``` The expected behavior is to either check and report that negative axes are invalid or to wrap around.
---------------------------------------------------------------- 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: [email protected] With regards, Apache Git Services
