Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tflite: Add casts to std::min/std::max when comparing mis-matched types #45486

Merged
merged 1 commit into from Dec 9, 2020

Conversation

yennster
Copy link
Contributor

@yennster yennster commented Dec 8, 2020

On some targets, such as the STM32L4, type deduction fails for calls to std::min & std::max when comparing values with mis-matched types:

quantization_util.cpp:293:79: error: no matching function for call to 'min(double, float)'

quantization_util.cpp:293:79: note: deduced conflicting types for parameter 'const _Tp' ('double' and 'float')

This PR fixes this compilation error by casting <double> or <float> respectively to these type mis-matched std::min/std::max calls.

@google-ml-butler google-ml-butler bot added the size:S CL Change Size: Small label Dec 8, 2020
@google-cla
Copy link

google-cla bot commented Dec 8, 2020

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no label Dec 8, 2020
@yennster
Copy link
Contributor Author

yennster commented Dec 8, 2020

@googlebot I signed it!

@google-cla google-cla bot added cla: yes and removed cla: no labels Dec 8, 2020
@yennster yennster changed the title Add casts to std::min/std::max when comparing mis-matched types tflite: Add casts to std::min/std::max when comparing mis-matched types Dec 8, 2020
@abattery abattery self-requested a review December 8, 2020 23:43
@google-ml-butler google-ml-butler bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Dec 8, 2020
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Dec 8, 2020
@google-ml-butler google-ml-butler bot removed the ready to pull PR ready for merge process label Dec 9, 2020
@yennster
Copy link
Contributor Author

yennster commented Dec 9, 2020

@abattery Ready for re-review

@google-ml-butler google-ml-butler bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Dec 9, 2020
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Dec 9, 2020
@gbaned gbaned self-assigned this Dec 9, 2020
@gbaned gbaned added this to Assigned Reviewer in PR Queue via automation Dec 9, 2020
@gbaned gbaned added the comp:lite TF Lite related issues label Dec 9, 2020
@copybara-service copybara-service bot merged commit 750c773 into tensorflow:master Dec 9, 2020
PR Queue automation moved this from Assigned Reviewer to Merged Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes comp:lite TF Lite related issues ready to pull PR ready for merge process size:S CL Change Size: Small
Projects
PR Queue
  
Merged
Development

Successfully merging this pull request may close these issues.

None yet

4 participants