2 // Copyright © 2019 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
6 #include "ParserFlatbuffersSerializeFixture.hpp"
8 #include "../Deserializer.hpp"
10 #include <boost/test/unit_test.hpp>
14 BOOST_AUTO_TEST_SUITE(Deserializer)
16 struct DepthToSpaceFixture : public ParserFlatbuffersSerializeFixture
18 explicit DepthToSpaceFixture(const std::string& inputShape,
19 const std::string& outputShape,
20 const std::string& blockSize,
21 const std::string& dataLayout,
22 const std::string& dataType)
30 layer_type: "InputLayer",
36 layerName: "InputLayer",
40 connection: {sourceLayerIndex:0, outputSlotIndex:0 },
45 dimensions: )" + inputShape + R"(,
46 dataType: )" + dataType + R"(
54 layer_type: "DepthToSpaceLayer",
58 layerName: "DepthToSpaceLayer",
59 layerType: "DepthToSpace",
62 connection: {sourceLayerIndex:0, outputSlotIndex:0 },
67 dimensions: )" + outputShape + R"(,
68 dataType: )" + dataType + R"(
73 blockSize: )" + blockSize + R"(,
74 dataLayout: )" + dataLayout + R"(,
79 layer_type: "OutputLayer",
85 layerName: "OutputLayer",
89 connection: {sourceLayerIndex:1, outputSlotIndex:0 },
94 dimensions: )" + outputShape + R"(,
95 dataType: )" + dataType + R"(
105 SetupSingleInputSingleOutput("InputLayer", "OutputLayer");
109 struct DepthToSpaceFloat32Fixture : DepthToSpaceFixture
111 DepthToSpaceFloat32Fixture() : DepthToSpaceFixture("[ 1, 2, 2, 4 ]", // input shape
112 "[ 1, 4, 4, 1 ]", // output shape
114 "NHWC", // data layout
115 "Float32") {} // data type
118 BOOST_FIXTURE_TEST_CASE(DepthToSpaceFloat32, DepthToSpaceFloat32Fixture)
120 RunTest<4, armnn::DataType::Float32>(
125 9.f, 10.f, 11.f, 12.f,
126 13.f, 14.f, 15.f, 16.f
131 9.f, 10.f, 13.f, 14.f,
132 11.f, 12.f, 15.f, 16.f
136 BOOST_AUTO_TEST_SUITE_END()