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 <armnnDeserializer/IDeserializer.hpp>
12 BOOST_AUTO_TEST_SUITE(Deserializer)
14 struct ReshapeFixture : public ParserFlatbuffersSerializeFixture
16 explicit ReshapeFixture(const std::string &inputShape,
17 const std::string &targetShape,
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"(
48 layer_type: "ReshapeLayer",
52 layerName: "ReshapeLayer",
56 connection: {sourceLayerIndex:0, outputSlotIndex:0 },
61 dimensions: )" + inputShape + R"(,
62 dataType: )" + dataType + R"(
66 targetShape: )" + targetShape + R"(,
71 layer_type: "OutputLayer",
77 layerName: "OutputLayer",
81 connection: {sourceLayerIndex:0, outputSlotIndex:0 },
86 dimensions: )" + outputShape + R"(,
87 dataType: )" + dataType + R"(
94 SetupSingleInputSingleOutput("InputLayer", "OutputLayer");
98 struct SimpleReshapeFixture : ReshapeFixture
100 SimpleReshapeFixture() : ReshapeFixture("[ 1, 9 ]", "[ 3, 3 ]", "[ 3, 3 ]",
101 "QuantisedAsymm8") {}
104 struct SimpleReshapeFixture2 : ReshapeFixture
106 SimpleReshapeFixture2() : ReshapeFixture("[ 2, 2, 1, 1 ]",
112 BOOST_FIXTURE_TEST_CASE(ReshapeQuantisedAsymm8, SimpleReshapeFixture)
114 RunTest<2, armnn::DataType::QAsymmU8>(0,
115 { 1, 2, 3, 4, 5, 6, 7, 8, 9 },
116 { 1, 2, 3, 4, 5, 6, 7, 8, 9 });
119 BOOST_FIXTURE_TEST_CASE(ReshapeFloat32, SimpleReshapeFixture2)
121 RunTest<4, armnn::DataType::Float32>(0,
123 { 111, 85, 226, 3 });
127 BOOST_AUTO_TEST_SUITE_END()