ArmNN
 20.11
Relu.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include <boost/test/unit_test.hpp>
9 
10 BOOST_AUTO_TEST_SUITE(OnnxParser)
11 
12 struct 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: 1
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: 1
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 
64 BOOST_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 
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
BOOST_FIXTURE_TEST_CASE(ValidReluTest, ReluMainFixture)
Definition: Relu.cpp:64
BOOST_AUTO_TEST_SUITE_END()