Release 18.08
[platform/upstream/armnn.git] / src / armnnCaffeParser / test / TestPooling2d.cpp
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // See LICENSE file in the project root for full license information.
4 //
5 #include <boost/test/unit_test.hpp>
6 #include "armnnCaffeParser/ICaffeParser.hpp"
7 #include "ParserPrototxtFixture.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
54 BOOST_AUTO_TEST_SUITE_END()