Change the rounding policy of MUL from TO_ZERO to TO_NEAREST_EVEN (#1940)
author장지섭/동작제어Lab(SR)/Engineer/삼성전자 <jiseob.jang@samsung.com>
Fri, 13 Jul 2018 06:23:55 +0000 (15:23 +0900)
committer이춘석/동작제어Lab(SR)/Staff Engineer/삼성전자 <chunseok.lee@samsung.com>
Fri, 13 Jul 2018 06:23:55 +0000 (15:23 +0900)
This commit changes the rounding policy of MUL from TO_ZERO to TO_NEAREST_EVEN.

If the rounding policy is TO_NEAREST_EVEN, it is most similar to the result of the TFLITE interpreter.

Signed-off-by: jiseob.jang <jiseob.jang@samsung.com>
runtimes/pure_arm_compute/src/compilation.cc

index 4ddd5cf..4b28821 100644 (file)
@@ -588,7 +588,8 @@ void Planner::visit(const ::internal::tflite::op::Mul::Node &node)
 
     fn->configure(lhs_input_alloc, rhs_input_alloc, output_alloc,
                   1.0, // scale
-                  arm_compute::ConvertPolicy::SATURATE, arm_compute::RoundingPolicy::TO_ZERO);
+                  arm_compute::ConvertPolicy::SATURATE,
+                  arm_compute::RoundingPolicy::TO_NEAREST_EVEN);
 
     builder.append("Mul", std::move(fn));