blob: 55517a0695e25556d3d0313b0714bbdc010a72e7 [file] [log] [blame]
Laurent Carlier749294b2020-06-01 09:03:17 +01001//
telsoa014fcda012018-03-09 14:13:49 +00002// Copyright © 2017 Arm Ltd. All rights reserved.
David Beckecb56cd2018-09-05 12:52:57 +01003// SPDX-License-Identifier: MIT
telsoa014fcda012018-03-09 14:13:49 +00004//
5#include <boost/test/unit_test.hpp>
6#include "armnnCaffeParser/ICaffeParser.hpp"
7#include "ParserPrototxtFixture.hpp"
8
9BOOST_AUTO_TEST_SUITE(CaffeParser)
10
telsoa01c577f2c2018-08-31 09:22:23 +010011struct GlobalPoolingFixture : public armnnUtils::ParserPrototxtFixture<armnnCaffeParser::ICaffeParser>
telsoa014fcda012018-03-09 14:13:49 +000012{
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
36BOOST_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
54BOOST_AUTO_TEST_SUITE_END()