0016-tflite_support-fix-absolute-value-function-abs-when-.patch 1.3 KB

123456789101112131415161718192021222324252627
  1. From 09ba82d9ad950f68e02a0aaf559fe062636fdf8d Mon Sep 17 00:00:00 2001
  2. From: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
  3. Date: Wed, 3 Aug 2022 17:19:28 +0800
  4. Subject: [PATCH 16/68] tflite_support: fix absolute value function 'abs' when
  5. argument is floating point
  6. Signed-off-by: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
  7. ---
  8. .../src/tensorflow_lite_support/cc/task/core/category.h | 2 +-
  9. 1 file changed, 1 insertion(+), 1 deletion(-)
  10. diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/core/category.h b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/core/category.h
  11. index 9fadd6a5cfe8..8dfed71da46d 100644
  12. --- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/core/category.h
  13. +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/core/category.h
  14. @@ -33,7 +33,7 @@ struct Category {
  15. friend bool operator==(const Category& lhs, const Category& rhs) {
  16. constexpr const double kScoreTolerance = 1e-6;
  17. return lhs.class_name == rhs.class_name &&
  18. - abs((double)(lhs.score - rhs.score)) <= kScoreTolerance;
  19. + fabs((double)(lhs.score - rhs.score)) <= kScoreTolerance;
  20. }
  21. friend bool operator!=(const Category& lhs, const Category& rhs) {
  22. --
  23. 2.30.2