ArmNN
 24.08
IDeserializer.hpp
Go to the documentation of this file.
1 //
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 
17 {
19 {
22 };
23 
24 class IDeserializer;
25 using IDeserializerPtr = std::unique_ptr<IDeserializer, void(*)(IDeserializer* parser)>;
26 
28 {
29 public:
30  static IDeserializer* CreateRaw();
31  static IDeserializerPtr Create();
32  static void Destroy(IDeserializer* parser);
33 
34  /// Create an input network from binary file contents
35  armnn::INetworkPtr CreateNetworkFromBinary(const std::vector<uint8_t>& binaryContent);
36 
37  /// Create an input network from a binary input stream
38  armnn::INetworkPtr CreateNetworkFromBinary(std::istream& binaryContent);
39 
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;
43 
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;
47 
48 private:
49  IDeserializer();
50  ~IDeserializer();
51 
52  class DeserializerImpl;
53  std::unique_ptr<DeserializerImpl> pDeserializerImpl;
54 };
55 } //namespace armnnDeserializer
armnn::INetworkPtr
std::unique_ptr< INetwork, void(*)(INetwork *network)> INetworkPtr
Definition: INetwork.hpp:339
armnnDeserializer::IDeserializer::Create
static IDeserializerPtr Create()
Definition: Deserializer.cpp:47
armnnDeserializer::IDeserializer::CreateRaw
static IDeserializer * CreateRaw()
Definition: Deserializer.cpp:42
armnnDeserializer::IDeserializerPtr
std::unique_ptr< IDeserializer, void(*)(IDeserializer *parser)> IDeserializerPtr
Definition: IDeserializer.hpp:25
armnnDeserializer
Definition: IDeserializer.hpp:16
armnn::TensorInfo
Definition: Tensor.hpp:152
armnnDeserializer::BindingPointInfo
Definition: IDeserializer.hpp:18
armnnDeserializer::IDeserializer::DeserializerImpl
Definition: Deserializer.hpp:34
INetwork.hpp
armnnDeserializer::BindingPointInfo::m_BindingId
armnn::LayerBindingId m_BindingId
Definition: IDeserializer.hpp:20
armnn::LayerBindingId
int LayerBindingId
Type of identifiers for bindable layers (inputs, outputs).
Definition: Types.hpp:309
armnnDeserializer::IDeserializer
Definition: IDeserializer.hpp:27
armnnDeserializer::IDeserializer::GetNetworkOutputBindingInfo
BindingPointInfo GetNetworkOutputBindingInfo(unsigned int layerId, const std::string &name) const
Retrieve binding info (layer id and tensor info) for the network output identified by the given layer...
Definition: Deserializer.cpp:72
Tensor.hpp
armnnDeserializer::IDeserializer::GetNetworkInputBindingInfo
BindingPointInfo GetNetworkInputBindingInfo(unsigned int layerId, const std::string &name) const
Retrieve binding info (layer id and tensor info) for the network input identified by the given layer ...
Definition: Deserializer.cpp:67
Types.hpp
armnnDeserializer::IDeserializer::CreateNetworkFromBinary
armnn::INetworkPtr CreateNetworkFromBinary(const std::vector< uint8_t > &binaryContent)
Create an input network from binary file contents.
Definition: Deserializer.cpp:57
NetworkFwd.hpp
armnnDeserializer::IDeserializer::Destroy
static void Destroy(IDeserializer *parser)
Definition: Deserializer.cpp:52
armnnDeserializer::BindingPointInfo::m_TensorInfo
armnn::TensorInfo m_TensorInfo
Definition: IDeserializer.hpp:21