blob: 8aa116192d0919aaf0bcbbed407c630f09630b43 [file] [log] [blame]
telsoa01c577f2c2018-08-31 09:22:23 +01001//
Finn Williamsb49ed182021-06-29 15:50:08 +01002// Copyright © 2017 Arm Ltd and Contributors. All rights reserved.
David Beckecb56cd2018-09-05 12:52:57 +01003// SPDX-License-Identifier: MIT
telsoa01c577f2c2018-08-31 09:22:23 +01004//
5
telsoa01c577f2c2018-08-31 09:22:23 +01006#include "ParserFlatbuffersFixture.hpp"
telsoa01c577f2c2018-08-31 09:22:23 +01007
telsoa01c577f2c2018-08-31 09:22:23 +01008
Sadik Armagan1625efc2021-06-10 18:24:34 +01009TEST_SUITE("TensorflowLiteParser_Softmax")
10{
telsoa01c577f2c2018-08-31 09:22:23 +010011struct SoftmaxFixture : public ParserFlatbuffersFixture
12{
13 explicit SoftmaxFixture()
14 {
15 m_JsonString = R"(
16 {
17 "version": 3,
18 "operator_codes": [ { "builtin_code": "SOFTMAX" } ],
19 "subgraphs": [ {
20 "tensors": [
21 {
22 "shape": [ 1, 7 ],
23 "type": "UINT8",
24 "buffer": 0,
25 "name": "inputTensor",
26 "quantization": {
27 "min": [ 0.0 ],
28 "max": [ 255.0 ],
29 "scale": [ 1.0 ],
30 "zero_point": [ 0 ],
31 }
32 },
33 {
34 "shape": [ 1, 7 ],
35 "type": "UINT8",
36 "buffer": 1,
37 "name": "outputTensor",
38 "quantization": {
39 "min": [ 0.0 ],
40 "max": [ 255.0 ],
41 "scale": [ 0.00390625 ],
42 "zero_point": [ 0 ],
43 }
44 }
45 ],
46 "inputs": [ 0 ],
47 "outputs": [ 1 ],
48 "operators": [
49 {
50 "opcode_index": 0,
51 "inputs": [ 0 ],
52 "outputs": [ 1 ],
53 "builtin_options_type": "SoftmaxOptions",
54 "builtin_options": {
55 "beta": 1.0
56 },
57 "custom_options_format": "FLEXBUFFERS"
58 }
59 ],
60 } ],
61 "buffers" : [ {}, {} ]
62 }
63 )";
64 SetupSingleInputSingleOutput("inputTensor", "outputTensor");
65 }
66};
67
Sadik Armagan1625efc2021-06-10 18:24:34 +010068TEST_CASE_FIXTURE(SoftmaxFixture, "ParseSoftmaxLite")
telsoa01c577f2c2018-08-31 09:22:23 +010069{
Derek Lambertif90c56d2020-01-10 17:14:08 +000070 RunTest<2, armnn::DataType::QAsymmU8>(0, { 0, 0, 100, 0, 0, 0, 0 }, { 0, 0, 255, 0, 0, 0, 0 });
telsoa01c577f2c2018-08-31 09:22:23 +010071}
72
Sadik Armagan1625efc2021-06-10 18:24:34 +010073}