aboutsummaryrefslogtreecommitdiff
path: root/delegate/src/test/TestUtils.hpp
diff options
context:
space:
mode:
authorJan Eilers <jan.eilers@arm.com>2020-11-10 18:43:23 +0000
committerJim Flynn <jim.flynn@arm.com>2020-11-12 15:23:45 +0000
commite339bf681f13990c7db7c656b75c011e84c290a9 (patch)
tree08c9890978b68bcb2b702233cdd938199f4a691c /delegate/src/test/TestUtils.hpp
parenteca97819e4e7217776ad8f3ad2fcc1ef14e2761e (diff)
downloadarmnn-e339bf681f13990c7db7c656b75c011e84c290a9.tar.gz
IVGCVSW-5396 TfLiteDelegate: Implement the Resize operators
* Added resize biliniear and nearest neighbour operator support to the tflite delegate Signed-off-by: Jan Eilers <jan.eilers@arm.com> Change-Id: Id0113d6b865ea282c6f4de55e8419a6244a35f0e
Diffstat (limited to 'delegate/src/test/TestUtils.hpp')
-rw-r--r--delegate/src/test/TestUtils.hpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/delegate/src/test/TestUtils.hpp b/delegate/src/test/TestUtils.hpp
new file mode 100644
index 0000000000..162d62f3bb
--- /dev/null
+++ b/delegate/src/test/TestUtils.hpp
@@ -0,0 +1,26 @@
+//
+// Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#pragma once
+
+#include <tensorflow/lite/interpreter.h>
+
+namespace armnnDelegate
+{
+
+/// Can be used to assign input data from a vector to a model input.
+/// Example usage can be found in ResizeTesthelper.hpp
+template <typename T>
+void FillInput(std::unique_ptr<tflite::Interpreter>& interpreter, int inputIndex, std::vector<T>& inputValues)
+{
+ auto tfLiteDelegateInputId = interpreter->inputs()[inputIndex];
+ auto tfLiteDelageInputData = interpreter->typed_tensor<T>(tfLiteDelegateInputId);
+ for (unsigned int i = 0; i < inputValues.size(); ++i)
+ {
+ tfLiteDelageInputData[i] = inputValues[i];
+ }
+}
+
+} // namespace armnnDelegate