sxjscience opened a new issue #12268: Inconsistent type conversion from 
numpy.ndarray to mx.ndarray
URL: https://github.com/apache/incubator-mxnet/issues/12268
 
 
   When we create a mxnet ndarray using a numpy ndarray, the dtype will not be 
automatically transferred. However, if we create a mxnet ndarray based on an 
existing mxnet ndarray, the dtype will be kept to be the same.
   
   Example: 
   ```python
   import mxnet as mx
   import numpy as np
   dat_np_to_mx = mx.nd.array(np.arange(10, dtype=np.int32))
   dat_mx_to_mx =mx.nd.array(mx.nd.arange(10, dtype=np.int32)) 
   print(dat_np_to_mx.dtype, dat_mx_to_mx.dtype)
   ```
   Result: 
   ```<class 'numpy.float32'> <class 'numpy.int32'>```

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

Reply via email to