Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Many operators don't work for integer type #13220

Closed
eric-haibin-lin opened this issue Nov 12, 2018 · 5 comments · Fixed by #14251
Closed

Many operators don't work for integer type #13220

eric-haibin-lin opened this issue Nov 12, 2018 · 5 comments · Fixed by #14251

Comments

@eric-haibin-lin
Copy link
Member

Many operators implicitly cast data to float and return inaccurate results:

>>> mx.nd.array([50000001], dtype='int32')

[50000001]
<NDArray 1 @cpu(0)>

>>> mx.nd.array([50000001], dtype='int32').floor()

[50000000] ------------->  should be [50000001]
<NDArray 1 @cpu(0)> 

>> mx.nd.array([50000001], dtype='int32').round()

[50000000] ------------->  should be [50000001]
<NDArray 1 @cpu(0)>
>>> mx.nd.array([50000001], dtype='int32').ceil()

[50000000] ------------->  should be [50000001]
<NDArray 1 @cpu(0)>
>>> mx.nd.array([50000001], dtype='int32').trunc()

[50000000] ------------->  should be [50000001]
<NDArray 1 @cpu(0)> 
@apeforest
Copy link
Contributor

apeforest commented Nov 14, 2018

@mxnet-label-bot add [Good First Issue, Call for Contribution]

@kalyc
Copy link
Contributor

kalyc commented Nov 14, 2018

Thanks for reporting the issue @eric-haibin-lin
Could you also add a link to the relevant place in the code where changes need to be made?

@hanzhaogang
Copy link

hanzhaogang commented Nov 23, 2018

Hard to trace. Can't find the gen_op module in the current package while working on this line:
from .gen_op import * # pylint: disable=unused-wildcard-import.

@eric-haibin-lin
Copy link
Member Author

@Vikas-kum
Copy link
Contributor

@anirudh2290 Please tag PR-work-in-progress

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants