6 #include <boost/test/unit_test.hpp> 8 #include "../Deserializer.hpp" 17 explicit Pooling2dFixture(
const std::string &inputShape,
18 const std::string &outputShape,
19 const std::string &dataType,
20 const std::string &dataLayout,
21 const std::string &poolingAlgorithm)
29 layer_type: "InputLayer", 35 layerName: "InputLayer", 39 connection: {sourceLayerIndex:0, outputSlotIndex:0 }, 44 dimensions: )" + inputShape + R"(, 45 dataType: )" + dataType + R"( 50 layer_type: "Pooling2dLayer", 54 layerName: "Pooling2dLayer", 55 layerType: "Pooling2d", 58 connection: {sourceLayerIndex:0, outputSlotIndex:0 }, 63 dimensions: )" + outputShape + R"(, 64 dataType: )" + dataType + R"( 68 poolType: )" + poolingAlgorithm + R"(, 69 outputShapeRounding: "Floor", 70 paddingMethod: Exclude, 71 dataLayout: )" + dataLayout + R"(, 83 layer_type: "OutputLayer", 89 layerName: "OutputLayer", 93 connection: {sourceLayerIndex:1, outputSlotIndex:0 }, 98 dimensions: )" + outputShape + R"(, 99 dataType: )" + dataType + R"( 110 struct SimpleAvgPooling2dFixture : Pooling2dFixture
112 SimpleAvgPooling2dFixture() : Pooling2dFixture(
"[ 1, 2, 2, 1 ]",
"[ 1, 1, 1, 1 ]",
113 "Float32",
"NHWC",
"Average") {}
116 struct SimpleAvgPooling2dFixture2 : Pooling2dFixture
118 SimpleAvgPooling2dFixture2() : Pooling2dFixture(
"[ 1, 2, 2, 1 ]",
120 "QuantisedAsymm8",
"NHWC",
"Average") {}
123 struct SimpleMaxPooling2dFixture : Pooling2dFixture
125 SimpleMaxPooling2dFixture() : Pooling2dFixture(
"[ 1, 1, 2, 2 ]",
127 "Float32",
"NCHW",
"Max") {}
130 struct SimpleMaxPooling2dFixture2 : Pooling2dFixture
132 SimpleMaxPooling2dFixture2() : Pooling2dFixture(
"[ 1, 1, 2, 2 ]",
134 "QuantisedAsymm8",
"NCHW",
"Max") {}
139 RunTest<4, armnn::DataType::Float32>(0, { 2, 3, 5, 2 }, { 3 });
144 RunTest<4, armnn::DataType::QAsymmU8>(0,
151 RunTest<4, armnn::DataType::Float32>(0, { 2, 5, 5, 2 }, { 5 });
156 RunTest<4, armnn::DataType::QAsymmU8>(0,
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
void SetupSingleInputSingleOutput(const std::string &inputName, const std::string &outputName)
BOOST_FIXTURE_TEST_CASE(Pooling2dFloat32Avg, SimpleAvgPooling2dFixture)
BOOST_AUTO_TEST_SUITE_END()