telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
David Beck | ecb56cd | 2018-09-05 12:52:57 +0100 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 4 | // |
| 5 | |
| 6 | #include <boost/test/unit_test.hpp> |
| 7 | #include "armnnOnnxParser/IOnnxParser.hpp" |
| 8 | #include "ParserPrototxtFixture.hpp" |
| 9 | |
| 10 | BOOST_AUTO_TEST_SUITE(OnnxParser) |
| 11 | |
| 12 | struct 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 Martincigh | 44a7167 | 2018-12-11 13:46:52 +0000 | [diff] [blame] | 34 | elem_type: 1 |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 35 | shape { |
| 36 | dim { |
| 37 | dim_value: 2 |
| 38 | } |
| 39 | } |
| 40 | } |
| 41 | } |
| 42 | } |
| 43 | output { |
| 44 | name: "Output" |
| 45 | type { |
| 46 | tensor_type { |
Matteo Martincigh | 44a7167 | 2018-12-11 13:46:52 +0000 | [diff] [blame] | 47 | elem_type: 1 |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 48 | 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 | |
| 68 | BOOST_FIXTURE_TEST_CASE(ProtoxtTest, ProtoxtTestFixture) |
| 69 | { |
| 70 | //TODO : add a test to check if the inputs and outputs are correctly inferred. |
| 71 | } |
| 72 | |
| 73 | BOOST_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 | |
| 81 | BOOST_AUTO_TEST_SUITE_END() |