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 | #pragma once |
| 6 | |
| 7 | #include <armnn/INetwork.hpp> |
| 8 | #include <armnn/Tensor.hpp> |
| 9 | |
| 10 | #include <memory> |
| 11 | #include <vector> |
| 12 | #include <map> |
| 13 | |
| 14 | namespace armnnOnnxParser |
| 15 | { |
| 16 | |
Jim Flynn | b4d7eae | 2019-05-01 14:44:27 +0100 | [diff] [blame] | 17 | using BindingPointInfo = armnn::BindingPointInfo; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 18 | |
| 19 | class IOnnxParser; |
| 20 | using IOnnxParserPtr = std::unique_ptr<IOnnxParser, void(*)(IOnnxParser* parser)>; |
| 21 | |
| 22 | class IOnnxParser |
| 23 | { |
| 24 | public: |
| 25 | static IOnnxParser* CreateRaw(); |
| 26 | static IOnnxParserPtr Create(); |
| 27 | static void Destroy(IOnnxParser* parser); |
| 28 | |
| 29 | /// Create the network from a protobuf binary file on disk |
| 30 | virtual armnn::INetworkPtr CreateNetworkFromBinaryFile(const char* graphFile) = 0; |
| 31 | |
| 32 | /// Create the network from a protobuf text file on disk |
| 33 | virtual armnn::INetworkPtr CreateNetworkFromTextFile(const char* graphFile) = 0; |
| 34 | |
| 35 | /// Create the network directly from protobuf text in a string. Useful for debugging/testing |
| 36 | virtual armnn::INetworkPtr CreateNetworkFromString(const std::string& protoText) = 0; |
| 37 | |
| 38 | /// Retrieve binding info (layer id and tensor info) for the network input identified by the given layer name |
| 39 | virtual BindingPointInfo GetNetworkInputBindingInfo(const std::string& name) const = 0; |
| 40 | |
| 41 | /// Retrieve binding info (layer id and tensor info) for the network output identified by the given layer name |
| 42 | virtual BindingPointInfo GetNetworkOutputBindingInfo(const std::string& name) const = 0; |
| 43 | |
| 44 | protected: |
| 45 | virtual ~IOnnxParser() {}; |
| 46 | }; |
| 47 | |
| 48 | } |