DickJC123 opened a new issue #20968:
URL: https://github.com/apache/incubator-mxnet/issues/20968


   ## Description
   This difference was flagged by the array api tests, so it's likely that 
mxnet.numpy is not producing the correct value.  Test failure log is: 
https://jenkins.mxnet-ci.com/blue/organizations/jenkins/mxnet-validation%2Funix-cpu/detail/PR-20957/3/pipeline/286/#step-438-log-636
   
   When mxnet.numpy does a right shift on a uint64 type, if uses a low level 
instruction that duplicates the most significant bit (i.e. an arithmetic right 
shift).  The simplest example showing the issue involves a right shift by 1 of 
2**63 (a value with just the most significant bit set):
   
   ```
   $python
   >>> import mxnet.numpy as mxnp
   >>> import numpy as np
   >>> 2**63
   9223372036854775808
   >>> bin(2**63)
   '0b1000000000000000000000000000000000000000000000000000000000000000'
   >>> 2**63 >> 1
   4611686018427387904
   >>> np.right_shift(np.array(2**63, dtype='uint64'), np.array(1, 
dtype='uint8'))
   4611686018427387904
   >>> mxnp.bitwise_right_shift(mxnp.array(2**63, dtype='uint64'), 
mxnp.array(1, dtype='uint8'))
   array(13835058055282163712, dtype=uint64)
   >>> bin(13835058055282163712)
   '0b1100000000000000000000000000000000000000000000000000000000000000'
   ```
   A recent issue I filed involving an array api unittest failure involved 
Cython vs. ctypes, but this issue is unrelated and most likely an issue with 
the cast to int64_t in the lines:
   
https://github.com/apache/incubator-mxnet/blob/master/src/operator/mshadow_op.h#L835-L847
   


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to