From fd33a698ee3c588aa4064b70b7781ab25ff76f66 Mon Sep 17 00:00:00 2001 From: Teresa Charlin Date: Wed, 29 Jun 2022 15:35:57 +0100 Subject: IVGCVSW-7040 Add support for LOG_SOFTMAX to the TFLiteParser Signed-off-by: Teresa Charlin Change-Id: I1fedfdf2cd8871d6b307fce8620f40adadf75f04 --- src/armnnTfLiteParser/test/LogSoftmax.cpp | 70 +++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 src/armnnTfLiteParser/test/LogSoftmax.cpp (limited to 'src/armnnTfLiteParser/test') diff --git a/src/armnnTfLiteParser/test/LogSoftmax.cpp b/src/armnnTfLiteParser/test/LogSoftmax.cpp new file mode 100644 index 0000000000..7414bc30a0 --- /dev/null +++ b/src/armnnTfLiteParser/test/LogSoftmax.cpp @@ -0,0 +1,70 @@ +// +// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#include "ParserFlatbuffersFixture.hpp" + + +TEST_SUITE("TensorflowLiteParser_LogSoftmax") +{ +struct LogSoftmaxFixture : public ParserFlatbuffersFixture +{ + explicit LogSoftmaxFixture() + { + m_JsonString = R"( + { + "version": 3, + "operator_codes": [ { "builtin_code": "LOG_SOFTMAX" } ], + "subgraphs": [ { + "tensors": [ + { + "shape": [ 1, 7 ], + "type": "UINT8", + "buffer": 0, + "name": "inputTensor", + "quantization": { + "min": [ 0.0 ], + "max": [ 255.0 ], + "scale": [ 1.0 ], + "zero_point": [ 0 ], + } + }, + { + "shape": [ 1, 7 ], + "type": "UINT8", + "buffer": 1, + "name": "outputTensor", + "quantization": { + "min": [ 0.0 ], + "max": [ 255.0 ], + "scale": [ 0.00390625 ], + "zero_point": [ 0 ], + } + } + ], + "inputs": [ 0 ], + "outputs": [ 1 ], + "operators": [ + { + "opcode_index": 0, + "inputs": [ 0 ], + "outputs": [ 1 ], + "builtin_options_type": "LogSoftmaxOptions", + "custom_options_format": "FLEXBUFFERS" + } + ], + } ], + "buffers" : [ {}, {} ] + } + )"; + SetupSingleInputSingleOutput("inputTensor", "outputTensor"); + } +}; + +TEST_CASE_FIXTURE(LogSoftmaxFixture, "ParseLogSoftmaxLite") +{ + RunTest<2, armnn::DataType::QAsymmU8>(0, { 0, 0, 100, 0, 0, 0, 0 }, { 0, 0, 255, 0, 0, 0, 0 }); +} + +} -- cgit v1.2.1