stu1130 opened a new issue #16357: Numpy Transpose Operator Inconsistency
URL: https://github.com/apache/incubator-mxnet/issues/16357
 
 
   Numpy 
   ```
   >>>import numpy as np
   >>> a = np.arange(4).reshape(2, 2)
   >>> np.transpose(a, (-1, 0))
   array([[0, 2],
          [1, 3]])
   ```
   MXNet Numpy
   ```
   >>>import mxnet as mx
   >>> a = mx.np.arange(4).reshape(2, 2)
   >>> mx.np.transpose(a, (-1, 0))
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "<string>", line 32, in transpose
     File 
"/Users/leecheng/workspace/incubator-mxnet/python/mxnet/_ctypes/ndarray.py", 
line 107, in _imperative_invoke
       ctypes.byref(out_stypes)))
     File "/Users/leecheng/workspace/incubator-mxnet/python/mxnet/base.py", 
line 254, in check_call
       raise MXNetError(py_str(_LIB.MXGetLastError()))
   mxnet.base.MXNetError: [11:05:51] ../include/mxnet/tuple.h:206: Check 
failed: i >= 0 && i < ndim(): index = -1 must be in range [0, 2)
   Stack trace:
     [bt] (0) 1   libmxnet.dylib                      0x000000011c094d53 
dmlc::LogMessageFatal::~LogMessageFatal() + 67
     [bt] (1) 2   libmxnet.dylib                      0x000000011c07f2b5 
dmlc::LogMessageFatal::~LogMessageFatal() + 21
     [bt] (2) 3   libmxnet.dylib                      0x000000011c084b2b 
mxnet::Tuple<long long>::operator[](int) + 411
     [bt] (3) 4   libmxnet.dylib                      0x000000011f053771 
mxnet::op::NumpyTransposeShape(nnvm::NodeAttrs const&, 
std::__1::vector<mxnet::TShape, std::__1::allocator<mxnet::TShape> >*, 
std::__1::vector<mxnet::TShape, std::__1::allocator<mxnet::TShape> >*) + 2177
     [bt] (4) 5   libmxnet.dylib                      0x000000011c63d80f 
decltype(std::__1::forward<bool (*&)(nnvm::NodeAttrs const&, 
std::__1::vector<mxnet::TShape, std::__1::allocator<mxnet::TShape> >*, 
std::__1::vector<mxnet::TShape, std::__1::allocator<mxnet::TShape> 
>*)>(fp)(std::__1::forward<nnvm::NodeAttrs const&>(fp0), 
std::__1::forward<std::__1::vector<mxnet::TShape, 
std::__1::allocator<mxnet::TShape> >*>(fp0), 
std::__1::forward<std::__1::vector<mxnet::TShape, 
std::__1::allocator<mxnet::TShape> >*>(fp0))) std::__1::__invoke<bool 
(*&)(nnvm::NodeAttrs const&, std::__1::vector<mxnet::TShape, 
std::__1::allocator<mxnet::TShape> >*, std::__1::vector<mxnet::TShape, 
std::__1::allocator<mxnet::TShape> >*), nnvm::NodeAttrs const&, 
std::__1::vector<mxnet::TShape, std::__1::allocator<mxnet::TShape> >*, 
std::__1::vector<mxnet::TShape, std::__1::allocator<mxnet::TShape> >*>(bool 
(*&&&)(nnvm::NodeAttrs const&, std::__1::vector<mxnet::TShape, 
std::__1::allocator<mxnet::TShape> >*, std::__1::vector<mxnet::TShape, 
std::__1::allocator<mxnet::TShape> >*), nnvm::NodeAttrs const&&&, 
std::__1::vector<mxnet::TShape, std::__1::allocator<mxnet::TShape> >*&&, 
std::__1::vector<mxnet::TShape, std::__1::allocator<mxnet::TShape> >*&&) + 95
     [bt] (5) 6   libmxnet.dylib                      0x000000011c63d76c bool 
std::__1::__invoke_void_return_wrapper<bool>::__call<bool (*&)(nnvm::NodeAttrs 
const&, std::__1::vector<mxnet::TShape, std::__1::allocator<mxnet::TShape> >*, 
std::__1::vector<mxnet::TShape, std::__1::allocator<mxnet::TShape> >*), 
nnvm::NodeAttrs const&, std::__1::vector<mxnet::TShape, 
std::__1::allocator<mxnet::TShape> >*, std::__1::vector<mxnet::TShape, 
std::__1::allocator<mxnet::TShape> >*>(bool (*&&&)(nnvm::NodeAttrs const&, 
std::__1::vector<mxnet::TShape, std::__1::allocator<mxnet::TShape> >*, 
std::__1::vector<mxnet::TShape, std::__1::allocator<mxnet::TShape> >*), 
nnvm::NodeAttrs const&&&, std::__1::vector<mxnet::TShape, 
std::__1::allocator<mxnet::TShape> >*&&, std::__1::vector<mxnet::TShape, 
std::__1::allocator<mxnet::TShape> >*&&) + 92
     [bt] (6) 7   libmxnet.dylib                      0x000000011c63c563 
std::__1::__function::__func<bool (*)(nnvm::NodeAttrs const&, 
std::__1::vector<mxnet::TShape, std::__1::allocator<mxnet::TShape> >*, 
std::__1::vector<mxnet::TShape, std::__1::allocator<mxnet::TShape> >*), 
std::__1::allocator<bool (*)(nnvm::NodeAttrs const&, 
std::__1::vector<mxnet::TShape, std::__1::allocator<mxnet::TShape> >*, 
std::__1::vector<mxnet::TShape, std::__1::allocator<mxnet::TShape> >*)>, bool 
(nnvm::NodeAttrs const&, std::__1::vector<mxnet::TShape, 
std::__1::allocator<mxnet::TShape> >*, std::__1::vector<mxnet::TShape, 
std::__1::allocator<mxnet::TShape> >*)>::operator()(nnvm::NodeAttrs const&, 
std::__1::vector<mxnet::TShape, std::__1::allocator<mxnet::TShape> >*&&, 
std::__1::vector<mxnet::TShape, std::__1::allocator<mxnet::TShape> >*&&) + 99
     [bt] (7) 8   libmxnet.dylib                      0x000000011c3d0dcf 
std::__1::function<bool (nnvm::NodeAttrs const&, 
std::__1::vector<mxnet::TShape, std::__1::allocator<mxnet::TShape> >*, 
std::__1::vector<mxnet::TShape, std::__1::allocator<mxnet::TShape> 
>*)>::operator()(nnvm::NodeAttrs const&, std::__1::vector<mxnet::TShape, 
std::__1::allocator<mxnet::TShape> >*, std::__1::vector<mxnet::TShape, 
std::__1::allocator<mxnet::TShape> >*) const + 127
     [bt] (8) 9   libmxnet.dylib                      0x000000011c52d84e 
mxnet::imperative::SetShapeType(mxnet::Context const&, nnvm::NodeAttrs const&, 
std::__1::vector<mxnet::NDArray*, std::__1::allocator<mxnet::NDArray*> > 
const&, std::__1::vector<mxnet::NDArray*, std::__1::allocator<mxnet::NDArray*> 
> const&, mxnet::DispatchMode*) + 1294
   

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to