blob: 067b440990bae4d8dfdaf42fe9e17f07c2f8d2e1 [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_PrototxtFixture")
10{
telsoa01c577f2c2018-08-31 09:22:23 +010011struct ProtoxtTestFixture : public armnnUtils::ParserPrototxtFixture<armnnOnnxParser::IOnnxParser>
12{
13 ProtoxtTestFixture()
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 node {
24 input: "Input"
25 output: "Output"
26 name: "Plus112"
27 op_type: "Add "
28 }
29 input {
30 name: "Input"
31 type {
32 tensor_type {
Matteo Martincigh44a71672018-12-11 13:46:52 +000033 elem_type: 1
telsoa01c577f2c2018-08-31 09:22:23 +010034 shape {
35 dim {
36 dim_value: 2
37 }
38 }
39 }
40 }
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: 1
50 }
51 dim {
52 dim_value: 10
53 }
54 }
55 }
56 }
57 }
58 }
59 opset_import {
60 version: 7
61 })";
62 // Setup();
63 }
64};
65
66
Sadik Armagan1625efc2021-06-10 18:24:34 +010067TEST_CASE_FIXTURE(ProtoxtTestFixture, "ProtoxtTest")
telsoa01c577f2c2018-08-31 09:22:23 +010068{
69 //TODO : add a test to check if the inputs and outputs are correctly inferred.
70}
71
Sadik Armagan1625efc2021-06-10 18:24:34 +010072TEST_CASE_FIXTURE(ProtoxtTestFixture, "ProtoxtTestWithBadInputs")
telsoa01c577f2c2018-08-31 09:22:23 +010073{
74
Sadik Armagan1625efc2021-06-10 18:24:34 +010075 // CHECK_THROWS_AS(RunTest<4>({{ "InexistantInput" , {0.0, 1.0, 2.0, 3.0}}},
telsoa01c577f2c2018-08-31 09:22:23 +010076 // {{ "InexistantOutput" , {0.0, 1.0, 2.0, 3.0}}}),
77 // armnn::InvalidArgumentException );
78}
79
Sadik Armagan1625efc2021-06-10 18:24:34 +010080}