blob: 162d62f3bbe73e4f62aeaab0ba2c052ea86637db [file] [log] [blame]
Jan Eilerse339bf62020-11-10 18:43:23 +00001//
2// Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#pragma once
7
8#include <tensorflow/lite/interpreter.h>
9
10namespace armnnDelegate
11{
12
13/// Can be used to assign input data from a vector to a model input.
14/// Example usage can be found in ResizeTesthelper.hpp
15template <typename T>
16void FillInput(std::unique_ptr<tflite::Interpreter>& interpreter, int inputIndex, std::vector<T>& inputValues)
17{
18 auto tfLiteDelegateInputId = interpreter->inputs()[inputIndex];
19 auto tfLiteDelageInputData = interpreter->typed_tensor<T>(tfLiteDelegateInputId);
20 for (unsigned int i = 0; i < inputValues.size(); ++i)
21 {
22 tfLiteDelageInputData[i] = inputValues[i];
23 }
24}
25
26} // namespace armnnDelegate