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 2018/10/17 00:43:21 UTC

[GitHub] zheng-da opened a new issue #12843: MXNet doesn't work with scipy int64

zheng-da opened a new issue #12843: MXNet doesn't work with scipy int64
URL: https://github.com/apache/incubator-mxnet/issues/12843
 
 
   The following code doesn't work.
   ```python
   import numpy as np
   import scipy as sp
   import mxnet as mx
   
   one = np.ones((2, 2), dtype='int64')
   print(np.dtype(one.dtype).type == np.int64)
   sp_one = sp.sparse.csr_matrix(one).data
   mx.nd.array(sp_one, dtype=sp_one.dtype)
   ```
   It generates the error as below:
   ```
   Traceback (most recent call last):
     File "test.py", line 8, in <module>
       mx.nd.array(sp_one, dtype=sp_one.dtype)
     File "/home/ubuntu/incubator-mxnet/python/mxnet/ndarray/utils.py", line 146, in array
       return _array(source_array, ctx=ctx, dtype=dtype)
     File "/home/ubuntu/incubator-mxnet/python/mxnet/ndarray/ndarray.py", line 2488, in array
       arr = empty(source_array.shape, ctx, dtype)
     File "/home/ubuntu/incubator-mxnet/python/mxnet/ndarray/ndarray.py", line 3874, in empty
       return NDArray(handle=_new_alloc_handle(shape, ctx, False, dtype))
     File "/home/ubuntu/incubator-mxnet/python/mxnet/ndarray/ndarray.py", line 139, in _new_alloc_handle
       ctypes.c_int(int(_DTYPE_NP_TO_MX[np.dtype(dtype).type])),
   KeyError: <type 'numpy.int64'>
   ```

----------------------------------------------------------------
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