blob: fb921320a3e3a9e321d9bc69383d5ff17a8d7c46 [file] [log] [blame]
telsoa01c577f2c2018-08-31 09:22:23 +01001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
David Beckecb56cd2018-09-05 12:52:57 +01003// SPDX-License-Identifier: MIT
telsoa01c577f2c2018-08-31 09:22:23 +01004//
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()