2 // Copyright © 2019 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
6 #include "ParserFlatbuffersSerializeFixture.hpp"
7 #include <armnnDeserializer/IDeserializer.hpp>
9 #include <boost/test/unit_test.hpp>
11 BOOST_AUTO_TEST_SUITE(Deserializer)
13 struct LogSoftmaxFixture : public ParserFlatbuffersSerializeFixture
15 explicit LogSoftmaxFixture(const std::string &shape,
16 const std::string &beta,
17 const std::string &axis,
18 const std::string &dataType)
26 layer_type: "InputLayer",
32 layerName: "InputLayer",
36 connection: { sourceLayerIndex:0, outputSlotIndex:0 },
41 dimensions: )" + shape + R"(,
42 dataType: ")" + dataType + R"(",
43 quantizationScale: 0.5,
52 layer_type: "LogSoftmaxLayer",
56 layerName: "LogSoftmaxLayer",
57 layerType: "LogSoftmax",
60 connection: { sourceLayerIndex:0, outputSlotIndex:0 },
65 dimensions: )" + shape + R"(,
66 dataType: ")" + dataType + R"("
71 beta: ")" + beta + R"(",
77 layer_type: "OutputLayer",
83 layerName: "OutputLayer",
87 connection: { sourceLayerIndex:1, outputSlotIndex:0 },
92 dimensions: )" + shape + R"(,
93 dataType: ")" + dataType + R"("
100 SetupSingleInputSingleOutput("InputLayer", "OutputLayer");
104 struct LogSoftmaxFloat32Fixture : LogSoftmaxFixture
106 LogSoftmaxFloat32Fixture() :
107 LogSoftmaxFixture("[ 1, 1, 2, 4 ]", // inputShape
110 "Float32") // dataType
114 BOOST_FIXTURE_TEST_CASE(LogSoftmaxFloat32, LogSoftmaxFloat32Fixture)
116 RunTest<4, armnn::DataType::Float32>(
123 -4.14297f, -10.14297f, -2.14297f, -0.14297f,
124 -7.00104f, -12.00104f, -0.00105f, -9.00104f
128 BOOST_AUTO_TEST_SUITE_END()