ArmNN
 20.02
TestPooling2d.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #include <boost/test/unit_test.hpp>
8 
9 BOOST_AUTO_TEST_SUITE(CaffeParser)
10 
11 struct GlobalPoolingFixture : public armnnUtils::ParserPrototxtFixture<armnnCaffeParser::ICaffeParser>
12 {
13  GlobalPoolingFixture()
14  {
15  m_Prototext = "name: \"GlobalPooling\"\n"
16  "layer {\n"
17  " name: \"data\"\n"
18  " type: \"Input\"\n"
19  " top: \"data\"\n"
20  " input_param { shape: { dim: 1 dim: 3 dim: 2 dim: 2 } }\n"
21  "}\n"
22  "layer {\n"
23  " bottom: \"data\"\n"
24  " top: \"pool1\"\n"
25  " name: \"pool1\"\n"
26  " type: \"Pooling\"\n"
27  " pooling_param {\n"
28  " pool: AVE\n"
29  " global_pooling: true\n"
30  " }\n"
31  "}\n";
32  SetupSingleInputSingleOutput("data", "pool1");
33  }
34 };
35 
36 BOOST_FIXTURE_TEST_CASE(GlobalPooling, GlobalPoolingFixture)
37 {
38  RunTest<4>(
39  {
40  1,3,
41  5,7,
42 
43  2,2,
44  2,2,
45 
46  4,4,
47  6,6
48  },
49  {
50  4, 2, 5
51  });
52 }
53 
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
BOOST_FIXTURE_TEST_CASE(GlobalPooling, GlobalPoolingFixture)
BOOST_AUTO_TEST_SUITE_END()
void SetupSingleInputSingleOutput(const std::string &inputName, const std::string &outputName)
Parses and loads the network defined by the m_Prototext string.