Release 18.08
[platform/upstream/armnn.git] / src / armnnCaffeParser / test / TestDropout.cpp
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // See LICENSE file in the project root for full license information.
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
12 struct DropoutFixture : public armnnUtils::ParserPrototxtFixture<armnnCaffeParser::ICaffeParser>
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()