ChaiBapchya commented on issue #14231: Numpy vs NDArray inconsistent values
URL: 
https://github.com/apache/incubator-mxnet/issues/14231#issuecomment-466291638
 
 
   @ZhennanQin Thanks!
   Right.
   Silly mistake. Forgot that our default datatype is Float!
   Verified that all 5 values are same
   **Numpy**
   ```
   >>> np.array(2**29)
   array(536870912)
   ```
   **MXNet**
   _Constant initializer as scalar_
   ```
   >>> mx.nd.array(2**29, dtype="int32")
   536870912
   <NDArray  @cpu(0)>
   >>> mx.nd.array(np.array(2**29), dtype="int32")
   536870912
   <NDArray  @cpu(0)>
   ```
   _Constant initializer as array/list_
   ```
   >>> mx.nd.array([2**29], dtype="int32")
   [536870912]
   <NDArray 1 @cpu(0)>
   >>> mx.nd.array([np.array(2**29)], dtype="int32")
   [536870912]
   <NDArray 1 @cpu(0)>
   ```

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