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 ReshapeFixture : public ParserFlatbuffersSerializeFixture
17 explicit ReshapeFixture(const std::string &inputShape,
18 const std::string &targetShape,
19 const std::string &outputShape,
20 const std::string &dataType)
28 layer_type: "InputLayer",
34 layerName: "InputLayer",
38 connection: {sourceLayerIndex:0, outputSlotIndex:0 },
43 dimensions: )" + inputShape + R"(,
44 dataType: )" + dataType + R"(
49 layer_type: "ReshapeLayer",
53 layerName: "ReshapeLayer",
57 connection: {sourceLayerIndex:0, outputSlotIndex:0 },
62 dimensions: )" + inputShape + R"(,
63 dataType: )" + dataType + R"(
67 targetShape: )" + targetShape + R"(,
72 layer_type: "OutputLayer",
78 layerName: "OutputLayer",
82 connection: {sourceLayerIndex:0, outputSlotIndex:0 },
87 dimensions: )" + outputShape + R"(,
88 dataType: )" + dataType + R"(
95 SetupSingleInputSingleOutput("InputLayer", "OutputLayer");
99 struct SimpleReshapeFixture : ReshapeFixture
101 SimpleReshapeFixture() : ReshapeFixture("[ 1, 9 ]", "[ 3, 3 ]", "[ 3, 3 ]",
102 "QuantisedAsymm8") {}
105 struct SimpleReshapeFixture2 : ReshapeFixture
107 SimpleReshapeFixture2() : ReshapeFixture("[ 2, 2, 1, 1 ]",
113 BOOST_FIXTURE_TEST_CASE(ReshapeQuantisedAsymm8, SimpleReshapeFixture)
115 RunTest<2, armnn::DataType::QAsymmU8>(0,
116 { 1, 2, 3, 4, 5, 6, 7, 8, 9 },
117 { 1, 2, 3, 4, 5, 6, 7, 8, 9 });
120 BOOST_FIXTURE_TEST_CASE(ReshapeFloat32, SimpleReshapeFixture2)
122 RunTest<4, armnn::DataType::Float32>(0,
124 { 111, 85, 226, 3 });
128 BOOST_AUTO_TEST_SUITE_END()