telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
David Beck | ecb56cd | 2018-09-05 12:52:57 +0100 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 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 MulFixture : public armnnUtils::ParserPrototxtFixture<armnnCaffeParser::ICaffeParser> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 12 | { |
| 13 | MulFixture() |
| 14 | { |
| 15 | m_Prototext = "name: \"MinimalMul\"\n" |
| 16 | "layer {\n" |
| 17 | " name: \"data\"\n" |
| 18 | " type: \"Input\"\n" |
| 19 | " top: \"data\"\n" |
| 20 | " input_param { shape: { dim: 1 dim: 1 dim: 4 dim: 4 } }\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 | " kernel_size: 2\n" |
| 29 | " stride: 2\n" |
| 30 | " pool: MAX\n" |
| 31 | " }\n" |
| 32 | "}\n" |
| 33 | "layer {\n" |
| 34 | " bottom: \"data\"\n" |
| 35 | " top: \"pool2\"\n" |
| 36 | " name: \"pool2\"\n" |
| 37 | " type: \"Pooling\"\n" |
| 38 | " pooling_param {\n" |
| 39 | " kernel_size: 2\n" |
| 40 | " stride: 2\n" |
| 41 | " pool: MAX\n" |
| 42 | " }\n" |
| 43 | "}\n" |
| 44 | "layer {\n" |
| 45 | " bottom: \"pool1\"\n" |
| 46 | " bottom: \"pool2\"\n" |
| 47 | " top: \"mul\"\n" |
| 48 | " name: \"mul\"\n" |
| 49 | " type: \"Eltwise\"\n" |
| 50 | " eltwise_param {\n" |
| 51 | " operation: 0\n" |
| 52 | " }\n" |
| 53 | "}\n"; |
| 54 | SetupSingleInputSingleOutput("data", "mul"); |
| 55 | } |
| 56 | }; |
| 57 | |
| 58 | BOOST_FIXTURE_TEST_CASE(ParseMul, MulFixture) |
| 59 | { |
| 60 | RunTest<4>( |
| 61 | { |
| 62 | 0, 1, 0, 0, |
| 63 | 0, 0, 0, 0, |
| 64 | 0, 0, 1, 0, |
| 65 | 1, 0, 1, 1 |
| 66 | }, |
| 67 | { |
| 68 | 1, 0, |
| 69 | 1, 1 |
| 70 | }); |
| 71 | } |
| 72 | |
| 73 | BOOST_AUTO_TEST_SUITE_END() |