6 #include <boost/test/unit_test.hpp> 16 explicit Pooling2dFixture(
const std::string &inputShape,
17 const std::string &outputShape,
18 const std::string &dataType,
19 const std::string &dataLayout,
20 const std::string &poolingAlgorithm)
28 layer_type: "InputLayer", 34 layerName: "InputLayer", 38 connection: {sourceLayerIndex:0, outputSlotIndex:0 }, 43 dimensions: )" + inputShape + R"(, 44 dataType: )" + dataType + R"( 49 layer_type: "Pooling2dLayer", 53 layerName: "Pooling2dLayer", 54 layerType: "Pooling2d", 57 connection: {sourceLayerIndex:0, outputSlotIndex:0 }, 62 dimensions: )" + outputShape + R"(, 63 dataType: )" + dataType + R"( 67 poolType: )" + poolingAlgorithm + R"(, 68 outputShapeRounding: "Floor", 69 paddingMethod: Exclude, 70 dataLayout: )" + dataLayout + R"(, 82 layer_type: "OutputLayer", 88 layerName: "OutputLayer", 92 connection: {sourceLayerIndex:1, outputSlotIndex:0 }, 97 dimensions: )" + outputShape + R"(, 98 dataType: )" + dataType + R"( 109 struct SimpleAvgPooling2dFixture : Pooling2dFixture
111 SimpleAvgPooling2dFixture() : Pooling2dFixture(
"[ 1, 2, 2, 1 ]",
"[ 1, 1, 1, 1 ]",
112 "Float32",
"NHWC",
"Average") {}
115 struct SimpleAvgPooling2dFixture2 : Pooling2dFixture
117 SimpleAvgPooling2dFixture2() : Pooling2dFixture(
"[ 1, 2, 2, 1 ]",
119 "QuantisedAsymm8",
"NHWC",
"Average") {}
122 struct SimpleMaxPooling2dFixture : Pooling2dFixture
124 SimpleMaxPooling2dFixture() : Pooling2dFixture(
"[ 1, 1, 2, 2 ]",
126 "Float32",
"NCHW",
"Max") {}
129 struct SimpleMaxPooling2dFixture2 : Pooling2dFixture
131 SimpleMaxPooling2dFixture2() : Pooling2dFixture(
"[ 1, 1, 2, 2 ]",
133 "QuantisedAsymm8",
"NCHW",
"Max") {}
138 RunTest<4, armnn::DataType::Float32>(0, { 2, 3, 5, 2 }, { 3 });
143 RunTest<4, armnn::DataType::QAsymmU8>(0,
150 RunTest<4, armnn::DataType::Float32>(0, { 2, 5, 5, 2 }, { 5 });
155 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()