aboutsummaryrefslogtreecommitdiff
path: root/delegate/src/test/RedefineTestHelper.hpp
diff options
context:
space:
mode:
authorNarumol Prangnawarat <narumol.prangnawarat@arm.com>2020-12-18 16:13:06 +0000
committerNarumol Prangnawarat <narumol.prangnawarat@arm.com>2021-01-13 11:53:53 +0000
commit4cf0fe385b934de95c022cae4a2c400d0d52377d (patch)
treeee6f9ac5f4c4b1d9d981ec9aff8b45e818259687 /delegate/src/test/RedefineTestHelper.hpp
parentfc78446118f65d78271136b33340c9fbb8c009f1 (diff)
downloadarmnn-4cf0fe385b934de95c022cae4a2c400d0d52377d.tar.gz
IVGCVSW-5625 Add support for Float16 to Delegate
* Float16 unit tests for Reshape * Remove unsupported data type from Pad Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com> Change-Id: Ib1804bb6e708a0552fb40d05fe8a6511936f9793
Diffstat (limited to 'delegate/src/test/RedefineTestHelper.hpp')
-rw-r--r--delegate/src/test/RedefineTestHelper.hpp25
1 files changed, 2 insertions, 23 deletions
diff --git a/delegate/src/test/RedefineTestHelper.hpp b/delegate/src/test/RedefineTestHelper.hpp
index ca8246c3a6..6f061572b4 100644
--- a/delegate/src/test/RedefineTestHelper.hpp
+++ b/delegate/src/test/RedefineTestHelper.hpp
@@ -136,7 +136,7 @@ void RedefineTest(tflite::BuiltinOperator redefineOperatorCode,
tflite::TensorType tensorType,
const std::vector<armnn::BackendId>& backends,
const std::vector<int32_t>& inputShape,
- const std::vector<int32_t>& outputShape,
+ std::vector<int32_t>& outputShape,
std::vector<T>& inputValues,
std::vector<T>& expectedOutputValues,
std::vector<int32_t>& targetShape,
@@ -186,28 +186,7 @@ void RedefineTest(tflite::BuiltinOperator redefineOperatorCode,
CHECK(tfLiteInterpreter->Invoke() == kTfLiteOk);
CHECK(armnnDelegateInterpreter->Invoke() == kTfLiteOk);
- auto tfLiteDelegateOutputId = tfLiteInterpreter->outputs()[0];
- auto tfLiteDelegateOutputData = tfLiteInterpreter->typed_tensor<T>(tfLiteDelegateOutputId);
- auto tfLiteDelegateOutputTensor = tfLiteInterpreter->tensor(tfLiteDelegateOutputId);
- auto armnnDelegateOutputId = armnnDelegateInterpreter->outputs()[0];
- auto armnnDelegateOutputData = armnnDelegateInterpreter->typed_tensor<T>(armnnDelegateOutputId);
- auto armnnDelegateOutputTensor = armnnDelegateInterpreter->tensor(armnnDelegateOutputId);
-
- CHECK(outputShape.size() == tfLiteDelegateOutputTensor->dims->size);
- CHECK(outputShape.size() == armnnDelegateOutputTensor->dims->size);
-
- for (size_t i = 0; i < static_cast<size_t>(tfLiteDelegateOutputTensor->dims->size); i++)
- {
- CHECK(outputShape[i] == armnnDelegateOutputTensor->dims->data[i]);
- CHECK(tfLiteDelegateOutputTensor->dims->data[i] == armnnDelegateOutputTensor->dims->data[i]);
- }
-
- for (size_t i = 0; i < expectedOutputValues.size(); i++)
- {
- CHECK(expectedOutputValues[i] == armnnDelegateOutputData[i]);
- CHECK(tfLiteDelegateOutputData[i] == expectedOutputValues[i]);
- CHECK(tfLiteDelegateOutputData[i] == armnnDelegateOutputData[i]);
- }
+ armnnDelegate::CompareOutputData<T>(tfLiteInterpreter, armnnDelegateInterpreter, outputShape, expectedOutputValues);
}
} // anonymous namespace \ No newline at end of file