Procházet zdrojové kódy

tflite_support: fix absolute value function 'abs' when argument is floating point

Signed-off-by: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
Rebecca Chang Swee Fun před 1 rokem
rodič
revize
ed5fac9772

+ 1 - 1
third_party/tflite_support/src/tensorflow_lite_support/cc/task/core/category.h

@@ -33,7 +33,7 @@ struct Category {
   friend bool operator==(const Category& lhs, const Category& rhs) {
     constexpr const double kScoreTolerance = 1e-6;
     return lhs.class_name == rhs.class_name &&
-           abs((double)(lhs.score - rhs.score)) <= kScoreTolerance;
+           fabs((double)(lhs.score - rhs.score)) <= kScoreTolerance;
   }
 
   friend bool operator!=(const Category& lhs, const Category& rhs) {