aboutsummaryrefslogtreecommitdiff
path: root/src/armnnTfParser/test/Softmax.cpp
blob: df304b68803082582755eebccce1f27b4a8e9027 (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
54
55
//
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//

#include <boost/test/unit_test.hpp>
#include "armnnTfParser/ITfParser.hpp"
#include "ParserPrototxtFixture.hpp"

BOOST_AUTO_TEST_SUITE(TensorflowParser)

struct SoftmaxFixture : public armnnUtils::ParserPrototxtFixture<armnnTfParser::ITfParser>
{
    SoftmaxFixture()
    {
        m_Prototext = "node {\n"
            "  name: \"blah\"\n"
            "  op: \"Placeholder\"\n"
            "  attr {\n"
            "    key: \"dtype\"\n"
            "    value {\n"
            "      type: DT_FLOAT\n"
            "    }\n"
            "  }\n"
            "  attr {\n"
            "    key: \"shape\"\n"
            "    value {\n"
            "      shape {\n"
            "      }\n"
            "    }\n"
            "  }\n"
            "}\n"
            "node {\n"
            "  name: \"blah2\"\n"
            "  op: \"Softmax\"\n"
            "  input: \"blah\"\n"
            "  attr {\n"
            "    key: \"T\"\n"
            "    value {\n"
            "      type: DT_FLOAT\n"
            "    }\n"
            "  }\n"
            "}\n";

        SetupSingleInputSingleOutput({ 1, 7 }, "blah", "blah2");
    }
};

BOOST_FIXTURE_TEST_CASE(ParseSoftmax, SoftmaxFixture)
{
    RunTest<2>({ 0, 0, 10000, 0, 0, 0, 0 }, { 0, 0, 1, 0, 0, 0, 0 });
}


BOOST_AUTO_TEST_SUITE_END()