2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
6 #include <boost/test/unit_test.hpp>
7 #include "ParserFlatbuffersSerializeFixture.hpp"
8 #include "../Deserializer.hpp"
13 BOOST_AUTO_TEST_SUITE(Deserializer)
15 struct AbsFixture : public ParserFlatbuffersSerializeFixture
17 explicit AbsFixture(const std::string &inputShape,
18 const std::string &outputShape,
19 const std::string &dataType)
27 layer_type: "InputLayer",
33 layerName: "InputLayer",
37 connection: {sourceLayerIndex:0, outputSlotIndex:0 },
42 dimensions: )" + inputShape + R"(,
43 dataType: )" + dataType + R"(
51 layer_type: "AbsLayer",
55 layerName: "AbsLayer",
59 connection: {sourceLayerIndex:0, outputSlotIndex:0 },
64 dimensions: )" + outputShape + R"(,
65 dataType: )" + dataType + R"(
73 layer_type: "OutputLayer",
79 layerName: "OutputLayer",
83 connection: {sourceLayerIndex:1, outputSlotIndex:0 },
88 dimensions: )" + outputShape + R"(,
89 dataType: )" + dataType + R"(
103 struct SimpleAbsFixture : AbsFixture
106 : AbsFixture("[ 1, 2, 2, 2 ]", // inputShape
107 "[ 1, 2, 2, 2 ]", // outputShape
108 "Float32") // dataType
112 BOOST_FIXTURE_TEST_CASE(SimpleAbsTest, SimpleAbsFixture)
114 RunTest<4, armnn::DataType::Float32>(
116 {{"InputLayer", { -100.0f, -50.5f, -25.9999f, -0.5f , 0.0f, 1.5555f, 25.5f, 100.0f }}},
117 {{"OutputLayer", { 100.0f, 50.5f, 25.9999f, 0.5f , 0.0f, 1.5555f, 25.5f, 100.0f }}});
120 BOOST_AUTO_TEST_SUITE_END()