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 2017/10/30 11:01:53 UTC
[GitHub] KellenSunderland opened a new pull request #8472: Fix arange bug on ARM
KellenSunderland opened a new pull request #8472: Fix arange bug on ARM
URL: https://github.com/apache/incubator-mxnet/pull/8472
## Description ##
This PR provides consistent behaviour for the arange operator between ARM and x86 devices.
## Checklist ##
### Essentials ###
- [x] Passed code style checking (`make lint`)
- [x] Changes are complete (i.e. I finished coding on this PR)
- [x] All changes have test coverage
- [x] For user-facing API changes, API doc string has been updated.
- [x] To my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change
### Changes ###
Fixes edge cases when running arange on ARM. These cases were failing the test_arange test. The problem was routed in the fact that converting from floats to unsigned in C++ happens differently on different platforms. ARM for example initializes the resulting unsigned data structure to 0, whereas x86 initializes it to the two's complement representation of the negative value. Numpy uses the two's complement form both on x86 and ARM. To maintain compatibility with Numpy, and consistency across devices I've changed our implementation to first cast to signed, then unsigned types. This forces 2's complement form on both architectures.
----------------------------------------------------------------
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