blob: 917f6f036be3b910232d1366b9597182975021d7 [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 ProtoxtTestFixture : public armnnUtils::ParserPrototxtFixture<armnnOnnxParser::IOnnxParser>
13{
14 ProtoxtTestFixture()
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 node {
25 input: "Input"
26 output: "Output"
27 name: "Plus112"
28 op_type: "Add "
29 }
30 input {
31 name: "Input"
32 type {
33 tensor_type {
Matteo Martincigh44a71672018-12-11 13:46:52 +000034 elem_type: 1
telsoa01c577f2c2018-08-31 09:22:23 +010035 shape {
36 dim {
37 dim_value: 2
38 }
39 }
40 }
41 }
42 }
43 output {
44 name: "Output"
45 type {
46 tensor_type {
Matteo Martincigh44a71672018-12-11 13:46:52 +000047 elem_type: 1
telsoa01c577f2c2018-08-31 09:22:23 +010048 shape {
49 dim {
50 dim_value: 1
51 }
52 dim {
53 dim_value: 10
54 }
55 }
56 }
57 }
58 }
59 }
60 opset_import {
61 version: 7
62 })";
63 // Setup();
64 }
65};
66
67
68BOOST_FIXTURE_TEST_CASE(ProtoxtTest, ProtoxtTestFixture)
69{
70 //TODO : add a test to check if the inputs and outputs are correctly inferred.
71}
72
73BOOST_FIXTURE_TEST_CASE(ProtoxtTestWithBadInputs, ProtoxtTestFixture)
74{
75
76 // BOOST_CHECK_THROW(RunTest<4>({{ "InexistantInput" , {0.0, 1.0, 2.0, 3.0}}},
77 // {{ "InexistantOutput" , {0.0, 1.0, 2.0, 3.0}}}),
78 // armnn::InvalidArgumentException );
79}
80
81BOOST_AUTO_TEST_SUITE_END()