blob: 991f64c3fcd132cd77defd7ef3296755b2902cb7 [file] [log] [blame]
telsoa01c577f2c2018-08-31 09:22:23 +01001//
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 "armnnOnnxParser/IOnnxParser.hpp"
8#include "ParserPrototxtFixture.hpp"
9
10BOOST_AUTO_TEST_SUITE(OnnxParser)
11
12struct ReluMainFixture : public armnnUtils::ParserPrototxtFixture<armnnOnnxParser::IOnnxParser>
13{
14 ReluMainFixture()
15 {
16 m_Prototext = R"(
17 ir_version: 3
18 producer_name: "CNTK"
19 producer_version: "2.5.1"
20 domain: "ai.cntk"
21 model_version: 1
22 graph {
23 name: "CNTKGraph"
24 input {
25 name: "Input"
26 type {
27 tensor_type {
28 elem_type: FLOAT
29 shape {
30 dim {
31 dim_value: 4
32 }
33 }
34 }
35 }
36 }
37 node {
38 input: "Input"
39 output: "Output"
40 name: "ActivationLayer"
41 op_type: "Relu"
42 }
43 output {
44 name: "Output"
45 type {
46 tensor_type {
47 elem_type: FLOAT
48 shape {
49 dim {
50 dim_value: 4
51 }
52 }
53 }
54 }
55 }
56 }
57 opset_import {
58 version: 7
59 })";
60 Setup();
61 }
62};
63
64BOOST_FIXTURE_TEST_CASE(ValidReluTest, ReluMainFixture)
65{
66 RunTest<1>({{"Input", { -1.0f, -0.5f, 1.25f, -3.0f}}},
67 {{ "Output", { 0.0f, 0.0f, 1.25f, 0.0f}}});
68}
69
70BOOST_AUTO_TEST_SUITE_END()