// // Copyright © 2017 Arm Ltd. All rights reserved. // SPDX-License-Identifier: MIT // #pragma once #include #include #include #include #include namespace armnnOnnxParser { using BindingPointInfo = armnn::BindingPointInfo; class OnnxParserImpl; class IOnnxParser; using IOnnxParserPtr = std::unique_ptr; class IOnnxParser { public: static IOnnxParser* CreateRaw(); static IOnnxParserPtr Create(); static void Destroy(IOnnxParser* parser); /// Create the network from a protobuf binary file on disk armnn::INetworkPtr CreateNetworkFromBinaryFile(const char* graphFile); /// Create the network from a protobuf text file on disk armnn::INetworkPtr CreateNetworkFromTextFile(const char* graphFile); /// Create the network directly from protobuf text in a string. Useful for debugging/testing armnn::INetworkPtr CreateNetworkFromString(const std::string& protoText); /// Create the network from a protobuf binary file on disk, with inputShapes specified armnn::INetworkPtr CreateNetworkFromBinaryFile(const char* graphFile, const std::map& inputShapes); /// Create the network from a protobuf text file on disk, with inputShapes specified armnn::INetworkPtr CreateNetworkFromTextFile(const char* graphFile, const std::map& inputShapes); /// Create the network directly from protobuf text in a string, with inputShapes specified. /// Useful for debugging/testing armnn::INetworkPtr CreateNetworkFromString(const std::string& protoText, const std::map& inputShapes); /// Retrieve binding info (layer id and tensor info) for the network input identified by the given layer name BindingPointInfo GetNetworkInputBindingInfo(const std::string& name) const; /// Retrieve binding info (layer id and tensor info) for the network output identified by the given layer name BindingPointInfo GetNetworkOutputBindingInfo(const std::string& name) const; private: IOnnxParser(); ~IOnnxParser(); std::unique_ptr pOnnxParserImpl; }; }