[nnapi_test] Fix float equality condition (#408)
author박종현/동작제어Lab(SR)/Senior Engineer/삼성전자 <jh1302.park@samsung.com>
Wed, 4 Apr 2018 02:03:27 +0000 (11:03 +0900)
committer이성재/동작제어Lab(SR)/Principal Engineer/삼성전자 <sj925.lee@samsung.com>
Wed, 4 Apr 2018 02:03:27 +0000 (11:03 +0900)
0.0f is not equal to 0.0f in the current equality condition.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
tools/nnapi_test/src/nnapi_test.cc

index 241d5b1..8e3ca26 100644 (file)
@@ -174,7 +174,7 @@ int main(const int argc, char **argv)
     const auto diff = std::fabs(expected - obtained);
     const auto max = std::max(std::fabs(expected), std::fabs(obtained));
 
-    return diff < max * FLT_EPSILON;
+    return diff <= max * FLT_EPSILON;
   };
 
   TfLiteTensorComparator comparator(compare_fn);