2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // See LICENSE file in the project root for full license information.
7 #include <armnn/INetwork.hpp>
8 #include <armnn/Tensor.hpp>
14 namespace armnnOnnxParser
17 using BindingPointInfo = std::pair<armnn::LayerBindingId, armnn::TensorInfo>;
20 using IOnnxParserPtr = std::unique_ptr<IOnnxParser, void(*)(IOnnxParser* parser)>;
25 static IOnnxParser* CreateRaw();
26 static IOnnxParserPtr Create();
27 static void Destroy(IOnnxParser* parser);
29 /// Create the network from a protobuf binary file on disk
30 virtual armnn::INetworkPtr CreateNetworkFromBinaryFile(const char* graphFile) = 0;
32 /// Create the network from a protobuf text file on disk
33 virtual armnn::INetworkPtr CreateNetworkFromTextFile(const char* graphFile) = 0;
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;
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;
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;
45 virtual ~IOnnxParser() {};