2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
7 #include "armnn/Types.hpp"
8 #include "armnn/NetworkFwd.hpp"
9 #include "armnn/Tensor.hpp"
10 #include "armnn/INetwork.hpp"
16 namespace armnnDeserializer
18 struct BindingPointInfo
20 armnn::LayerBindingId m_BindingId;
21 armnn::TensorInfo m_TensorInfo;
25 using IDeserializerPtr = std::unique_ptr<IDeserializer, void(*)(IDeserializer* parser)>;
30 static IDeserializer* CreateRaw();
31 static IDeserializerPtr Create();
32 static void Destroy(IDeserializer* parser);
34 /// Create an input network from binary file contents
35 armnn::INetworkPtr CreateNetworkFromBinary(const std::vector<uint8_t>& binaryContent);
37 /// Create an input network from a binary input stream
38 armnn::INetworkPtr CreateNetworkFromBinary(std::istream& binaryContent);
40 /// Retrieve binding info (layer id and tensor info) for the network input identified by
41 /// the given layer name and layers id
42 BindingPointInfo GetNetworkInputBindingInfo(unsigned int layerId, const std::string& name) const;
44 /// Retrieve binding info (layer id and tensor info) for the network output identified by
45 /// the given layer name and layers id
46 BindingPointInfo GetNetworkOutputBindingInfo(unsigned int layerId, const std::string& name) const;
52 class DeserializerImpl;
53 std::unique_ptr<DeserializerImpl> pDeserializerImpl;
55 } //namespace armnnDeserializer