blob: ab64dc9e144c7e39bc166db9d01cdd1b45dc6038 [file] [log] [blame]
Kevin May43a799c2019-02-08 16:31:42 +00001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5#pragma once
6
7#include "armnn/Types.hpp"
8#include "armnn/NetworkFwd.hpp"
9#include "armnn/Tensor.hpp"
10#include "armnn/INetwork.hpp"
11
12#include <memory>
13#include <map>
14#include <vector>
15
16namespace armnnDeserializeParser
17{
18
19using BindingPointInfo = std::pair<armnn::LayerBindingId, armnn::TensorInfo>;
20
21class IDeserializeParser;
22using IDeserializeParserPtr = std::unique_ptr<IDeserializeParser, void(*)(IDeserializeParser* parser)>;
23
24class IDeserializeParser
25{
26public:
27 static IDeserializeParser* CreateRaw();
28 static IDeserializeParserPtr Create();
29 static void Destroy(IDeserializeParser* parser);
30
Derek Lamberti2b183fb2019-02-18 16:36:57 +000031 /// Create an input network from binary file contents
Kevin May43a799c2019-02-08 16:31:42 +000032 virtual armnn::INetworkPtr CreateNetworkFromBinary(const std::vector<uint8_t>& binaryContent) = 0;
33
Derek Lamberti2b183fb2019-02-18 16:36:57 +000034 /// Create an input network from a binary input stream
35 virtual armnn::INetworkPtr CreateNetworkFromBinary(std::istream& binaryContent) = 0;
Kevin May43a799c2019-02-08 16:31:42 +000036
37 /// Retrieve binding info (layer id and tensor info) for the network input identified by
38 /// the given layer name and layers id
39 virtual BindingPointInfo GetNetworkInputBindingInfo(unsigned int layerId,
40 const std::string& name) const = 0;
41
42 /// Retrieve binding info (layer id and tensor info) for the network output identified by
43 /// the given layer name and layers id
44 virtual BindingPointInfo GetNetworkOutputBindingInfo(unsigned int layerId,
45 const std::string& name) const = 0;
46
47protected:
48 virtual ~IDeserializeParser() {};
49
50};
51}