blob: 031872e1c262ea20c083c86ff4aeff81b86ab5b8 [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
telsoa01c577f2c2018-08-31 09:22:23 +01006#include "armnnOnnxParser/IOnnxParser.hpp"
7#include "ParserPrototxtFixture.hpp"
8
Sadik Armagan1625efc2021-06-10 18:24:34 +01009TEST_SUITE("OnnxParser_Relu")
10{
telsoa01c577f2c2018-08-31 09:22:23 +010011struct ReluMainFixture : public armnnUtils::ParserPrototxtFixture<armnnOnnxParser::IOnnxParser>
12{
13 ReluMainFixture()
14 {
15 m_Prototext = R"(
16 ir_version: 3
17 producer_name: "CNTK"
18 producer_version: "2.5.1"
19 domain: "ai.cntk"
20 model_version: 1
21 graph {
22 name: "CNTKGraph"
23 input {
24 name: "Input"
25 type {
26 tensor_type {
Matteo Martincigh44a71672018-12-11 13:46:52 +000027 elem_type: 1
telsoa01c577f2c2018-08-31 09:22:23 +010028 shape {
29 dim {
30 dim_value: 4
31 }
32 }
33 }
34 }
35 }
36 node {
37 input: "Input"
38 output: "Output"
39 name: "ActivationLayer"
40 op_type: "Relu"
41 }
42 output {
43 name: "Output"
44 type {
45 tensor_type {
Matteo Martincigh44a71672018-12-11 13:46:52 +000046 elem_type: 1
telsoa01c577f2c2018-08-31 09:22:23 +010047 shape {
48 dim {
49 dim_value: 4
50 }
51 }
52 }
53 }
54 }
55 }
56 opset_import {
57 version: 7
58 })";
59 Setup();
60 }
61};
62
Sadik Armagan1625efc2021-06-10 18:24:34 +010063TEST_CASE_FIXTURE(ReluMainFixture, "ValidReluTest")
telsoa01c577f2c2018-08-31 09:22:23 +010064{
65 RunTest<1>({{"Input", { -1.0f, -0.5f, 1.25f, -3.0f}}},
66 {{ "Output", { 0.0f, 0.0f, 1.25f, 0.0f}}});
67}
68
Sadik Armagan1625efc2021-06-10 18:24:34 +010069}