aboutsummaryrefslogtreecommitdiff
path: root/include/armnnTfLiteParser
diff options
context:
space:
mode:
authortelsoa01 <telmo.soares@arm.com>2018-08-31 09:22:23 +0100
committertelsoa01 <telmo.soares@arm.com>2018-08-31 09:22:23 +0100
commitc577f2c6a3b4ddb6ba87a882723c53a248afbeba (patch)
treebd7d4c148df27f8be6649d313efb24f536b7cf34 /include/armnnTfLiteParser
parent4c7098bfeab1ffe1cdc77f6c15548d3e73274746 (diff)
downloadarmnn-c577f2c6a3b4ddb6ba87a882723c53a248afbeba.tar.gz
Release 18.08
Diffstat (limited to 'include/armnnTfLiteParser')
-rw-r--r--include/armnnTfLiteParser/ITfLiteParser.hpp61
1 files changed, 61 insertions, 0 deletions
diff --git a/include/armnnTfLiteParser/ITfLiteParser.hpp b/include/armnnTfLiteParser/ITfLiteParser.hpp
new file mode 100644
index 0000000000..a4f5e21327
--- /dev/null
+++ b/include/armnnTfLiteParser/ITfLiteParser.hpp
@@ -0,0 +1,61 @@
+//
+// Copyright © 2017 Arm Ltd. All rights reserved.
+// See LICENSE file in the project root for full license information.
+//
+#pragma once
+
+#include "armnn/Types.hpp"
+#include "armnn/NetworkFwd.hpp"
+#include "armnn/Tensor.hpp"
+#include "armnn/INetwork.hpp"
+
+#include <memory>
+#include <map>
+#include <vector>
+
+namespace armnnTfLiteParser
+{
+
+// TODO: revise this: do we really need this for every parser???
+using BindingPointInfo = std::pair<armnn::LayerBindingId, armnn::TensorInfo>;
+
+class ITfLiteParser;
+using ITfLiteParserPtr = std::unique_ptr<ITfLiteParser, void(*)(ITfLiteParser* parser)>;
+
+class ITfLiteParser
+{
+public:
+ static ITfLiteParser* CreateRaw();
+ static ITfLiteParserPtr Create();
+ static void Destroy(ITfLiteParser* parser);
+
+ /// Create the network from a flatbuffers binary file on disk
+ virtual armnn::INetworkPtr CreateNetworkFromBinaryFile(const char* graphFile) = 0;
+
+ /// Create the network from a flatbuffers binary
+ virtual armnn::INetworkPtr CreateNetworkFromBinary(const std::vector<uint8_t> & binaryContent) = 0;
+
+ /// Retrieve binding info (layer id and tensor info) for the network input identified by
+ /// the given layer name and subgraph id
+ virtual BindingPointInfo GetNetworkInputBindingInfo(size_t subgraphId,
+ const std::string& name) const = 0;
+
+ /// Retrieve binding info (layer id and tensor info) for the network output identified by
+ /// the given layer name and subgraph id
+ virtual BindingPointInfo GetNetworkOutputBindingInfo(size_t subgraphId,
+ const std::string& name) const = 0;
+
+ /// Return the number of subgraphs in the parsed model
+ virtual size_t GetSubgraphCount() const = 0;
+
+ /// Return the input tensor names for a given subgraph
+ virtual std::vector<std::string> GetSubgraphInputTensorNames(size_t subgraphId) const = 0;
+
+ /// Return the output tensor names for a given subgraph
+ virtual std::vector<std::string> GetSubgraphOutputTensorNames(size_t subgraphId) const = 0;
+
+protected:
+ virtual ~ITfLiteParser() {};
+};
+
+}