aboutsummaryrefslogtreecommitdiff
path: root/src/armnnCaffeParser/test/TestDropout.cpp
blob: 503766248bc3b49a7f145b1c7550d06f2522d756 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//

#include <boost/test/unit_test.hpp>
#include "armnnCaffeParser/ICaffeParser.hpp"
#include "ParserPrototxtFixture.hpp"

BOOST_AUTO_TEST_SUITE(CaffeParser)

struct DropoutFixture : public armnnUtils::ParserPrototxtFixture<armnnCaffeParser::ICaffeParser>
{
    DropoutFixture()
    {
        m_Prototext = "name: \"DropoutFixture\"\n"
            "layer {\n"
            "    name: \"data\"\n"
            "    type: \"Input\"\n"
            "    top: \"data\"\n"
            "    input_param { shape: { dim: 1 dim: 1 dim: 2 dim: 2 } }\n"
            "}\n"
            "layer {\n"
            "    bottom: \"data\"\n"
            "    top: \"drop1\"\n"
            "    name: \"drop1\"\n"
            "    type: \"Dropout\"\n"
            "}\n"
            "layer {\n"
            "    bottom: \"drop1\"\n"
            "    bottom: \"drop1\"\n"
            "    top: \"add\"\n"
            "    name: \"add\"\n"
            "    type: \"Eltwise\"\n"
            "}\n";
        SetupSingleInputSingleOutput("data", "add");
    }
};

BOOST_FIXTURE_TEST_CASE(ParseDropout, DropoutFixture)
{
    RunTest<4>(
        {
            1, 2,
            3, 4,
        },
        {
            2, 4,
            6, 8
        });
}

BOOST_AUTO_TEST_SUITE_END()