1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/pkg/tensorflow-lite/patches/0001-global-round.patch

34 lines
1.5 KiB
Diff

From e7d7acc96975ac47038fb7215925d4324b20aa86 Mon Sep 17 00:00:00 2001
From: Alexandre Abadie <alexandre.abadie@inria.fr>
Date: Tue, 17 Dec 2019 11:53:05 +0100
Subject: [PATCH] use global round function
---
tensorflow/lite/kernels/internal/reference/concatenation.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tensorflow/lite/kernels/internal/reference/concatenation.h b/tensorflow/lite/kernels/internal/reference/concatenation.h
index f587cfd1c9..3767112738 100644
--- a/tensorflow/lite/kernels/internal/reference/concatenation.h
+++ b/tensorflow/lite/kernels/internal/reference/concatenation.h
@@ -19,6 +19,7 @@ limitations under the License.
#include "tensorflow/lite/kernels/internal/common.h"
#include "tensorflow/lite/kernels/internal/compatibility.h"
#include "tensorflow/lite/kernels/internal/types.h"
+#include "tensorflow/lite/kernels/internal/round.h"
namespace tflite {
namespace reference_ops {
@@ -122,7 +123,7 @@ inline void ConcatenationWithScaling(const ConcatenationParams& params,
const float bias = -input_zeropoint[i] * scale;
for (int j = 0; j < copy_size; ++j) {
const int32_t value =
- static_cast<int32_t>(std::round(input_ptr[j] * scale + bias)) +
+ static_cast<int32_t>(tflite::TfLiteRound(input_ptr[j] * scale + bias)) +
output_zeropoint;
output_ptr[j] = static_cast<uint8_t>(
std::max<int32_t>(std::min<int32_t>(255, value), 0));
--
2.20.1