ArmNN
 21.02
TestDropout.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include <boost/test/unit_test.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 
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
BOOST_FIXTURE_TEST_CASE(ParseDropout, DropoutFixture)
Definition: TestDropout.cpp:40
BOOST_AUTO_TEST_SUITE_END()
void SetupSingleInputSingleOutput(const std::string &inputName, const std::string &outputName)
Parses and loads the network defined by the m_Prototext string.