telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 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 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 11 | struct GlobalPoolingFixture : public armnnUtils::ParserPrototxtFixture<armnnCaffeParser::ICaffeParser> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 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() |