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

warning: implicit conversion from 'const size_t' (aka 'const unsigned int') to 'float' changes value from 2147483647 to 2147483648 #20833

Closed
yurivict opened this issue Jan 20, 2022 · 2 comments

Comments

@yurivict
Copy link
Contributor

clang-12 complains:

/wrkdirs/usr/ports/misc/mxnet/work/incubator-mxnet-1.9.0/src/operator/quantization/quantized_elemwise_mul.cc:141:31: warning: implicit conversion from 'const size_t' (aka 'const unsigned int') to 'float' changes value from 2147483647 to 2147483648 [-Wimplicit-const-int-float-conversion]
    float output_data_range = kInt32Range;
          ~~~~~~~~~~~~~~~~~   ^~~~~~~~~~~

This looks like a real bug - the value get accidentally changed.

Version: 1.9.0
OS: FreeBSD 13

@anko-intel
Copy link
Contributor

anko-intel commented Jan 20, 2022

You are right.
But I am not sure if it is worth to fix it. Error in final results coming from it is minimal (or even it will be invisible), but for fixing it I have to change the type of output_data_range to double - so a couple of calculation below will be made on double - it takes more time.

@anko-intel
Copy link
Contributor

I have decided to remove compilation warning in #20854. The rounding error is to small to have infuence on final results.
@yurivict could you close the issue?

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

No branches or pull requests

2 participants