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 | |
| 6 | #include <boost/test/unit_test.hpp> |
| 7 | #include "armnnCaffeParser/ICaffeParser.hpp" |
| 8 | #include "ParserPrototxtFixture.hpp" |
| 9 | |
| 10 | BOOST_AUTO_TEST_SUITE(CaffeParser) |
| 11 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 12 | struct DropoutFixture : public armnnUtils::ParserPrototxtFixture<armnnCaffeParser::ICaffeParser> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 13 | { |
| 14 | DropoutFixture() |
| 15 | { |
| 16 | m_Prototext = "name: \"DropoutFixture\"\n" |
| 17 | "layer {\n" |
| 18 | " name: \"data\"\n" |
| 19 | " type: \"Input\"\n" |
| 20 | " top: \"data\"\n" |
| 21 | " input_param { shape: { dim: 1 dim: 1 dim: 2 dim: 2 } }\n" |
| 22 | "}\n" |
| 23 | "layer {\n" |
| 24 | " bottom: \"data\"\n" |
| 25 | " top: \"drop1\"\n" |
| 26 | " name: \"drop1\"\n" |
| 27 | " type: \"Dropout\"\n" |
| 28 | "}\n" |
| 29 | "layer {\n" |
| 30 | " bottom: \"drop1\"\n" |
| 31 | " bottom: \"drop1\"\n" |
| 32 | " top: \"add\"\n" |
| 33 | " name: \"add\"\n" |
| 34 | " type: \"Eltwise\"\n" |
| 35 | "}\n"; |
| 36 | SetupSingleInputSingleOutput("data", "add"); |
| 37 | } |
| 38 | }; |
| 39 | |
| 40 | BOOST_FIXTURE_TEST_CASE(ParseDropout, DropoutFixture) |
| 41 | { |
| 42 | RunTest<4>( |
| 43 | { |
| 44 | 1, 2, |
| 45 | 3, 4, |
| 46 | }, |
| 47 | { |
| 48 | 2, 4, |
| 49 | 6, 8 |
| 50 | }); |
| 51 | } |
| 52 | |
| 53 | BOOST_AUTO_TEST_SUITE_END() |