12 #include <unordered_map> 19 using GraphPtr =
const armnnSerializer::SerializedGraph *;
63 unsigned int layerIndex);
71 const std::vector<uint32_t> & targetDimsIn);
80 void ParseUnsupportedLayer(
GraphPtr graph,
unsigned int layerIndex);
81 void ParseAbs(
GraphPtr graph,
unsigned int layerIndex);
82 void ParseActivation(
GraphPtr graph,
unsigned int layerIndex);
83 void ParseAdd(
GraphPtr graph,
unsigned int layerIndex);
84 void ParseArgMinMax(
GraphPtr graph,
unsigned int layerIndex);
85 void ParseBatchToSpaceNd(
GraphPtr graph,
unsigned int layerIndex);
86 void ParseBatchNormalization(
GraphPtr graph,
unsigned int layerIndex);
87 void ParseComparison(
GraphPtr graph,
unsigned int layerIndex);
88 void ParseConcat(
GraphPtr graph,
unsigned int layerIndex);
89 void ParseConstant(
GraphPtr graph,
unsigned int layerIndex);
90 void ParseConvolution2d(
GraphPtr graph,
unsigned int layerIndex);
91 void ParseDepthToSpace(
GraphPtr graph,
unsigned int layerIndex);
92 void ParseDepthwiseConvolution2d(
GraphPtr graph,
unsigned int layerIndex);
93 void ParseDequantize(
GraphPtr graph,
unsigned int layerIndex);
94 void ParseDetectionPostProcess(
GraphPtr graph,
unsigned int layerIndex);
95 void ParseDivision(
GraphPtr graph,
unsigned int layerIndex);
96 void ParseElementwiseUnary(
GraphPtr graph,
unsigned int layerIndex);
97 void ParseEqual(
GraphPtr graph,
unsigned int layerIndex);
98 void ParseFill(
GraphPtr graph,
unsigned int layerIndex);
99 void ParseFloor(
GraphPtr graph,
unsigned int layerIndex);
100 void ParseFullyConnected(
GraphPtr graph,
unsigned int layerIndex);
101 void ParseGather(
GraphPtr graph,
unsigned int layerIndex);
102 void ParseGreater(
GraphPtr graph,
unsigned int layerIndex);
103 void ParseInstanceNormalization(
GraphPtr graph,
unsigned int layerIndex);
104 void ParseL2Normalization(
GraphPtr graph,
unsigned int layerIndex);
105 void ParseLogicalBinary(
GraphPtr graph,
unsigned int layerIndex);
106 void ParseLogSoftmax(
GraphPtr graph,
unsigned int layerIndex);
107 void ParseMaximum(
GraphPtr graph,
unsigned int layerIndex);
108 void ParseMean(
GraphPtr graph,
unsigned int layerIndex);
109 void ParseMinimum(
GraphPtr graph,
unsigned int layerIndex);
110 void ParseMerge(
GraphPtr graph,
unsigned int layerIndex);
111 void ParseMultiplication(
GraphPtr graph,
unsigned int layerIndex);
112 void ParseNormalization(
GraphPtr graph,
unsigned int layerIndex);
113 void ParseLstm(
GraphPtr graph,
unsigned int layerIndex);
114 void ParseQuantizedLstm(
GraphPtr graph,
unsigned int layerIndex);
115 void ParsePad(
GraphPtr graph,
unsigned int layerIndex);
116 void ParsePermute(
GraphPtr graph,
unsigned int layerIndex);
117 void ParsePooling2d(
GraphPtr graph,
unsigned int layerIndex);
118 void ParsePrelu(
GraphPtr graph,
unsigned int layerIndex);
119 void ParseQLstm(
GraphPtr graph,
unsigned int layerIndex);
120 void ParseQuantize(
GraphPtr graph,
unsigned int layerIndex);
121 void ParseRank(
GraphPtr graph,
unsigned int layerIndex);
122 void ParseReduce(
GraphPtr graph,
unsigned int layerIndex);
123 void ParseReshape(
GraphPtr graph,
unsigned int layerIndex);
124 void ParseResize(
GraphPtr graph,
unsigned int layerIndex);
125 void ParseResizeBilinear(
GraphPtr graph,
unsigned int layerIndex);
126 void ParseRsqrt(
GraphPtr graph,
unsigned int layerIndex);
127 void ParseSlice(
GraphPtr graph,
unsigned int layerIndex);
128 void ParseSoftmax(
GraphPtr graph,
unsigned int layerIndex);
129 void ParseSpaceToBatchNd(
GraphPtr graph,
unsigned int layerIndex);
130 void ParseSpaceToDepth(
GraphPtr graph,
unsigned int layerIndex);
131 void ParseSplitter(
GraphPtr graph,
unsigned int layerIndex);
132 void ParseStack(
GraphPtr graph,
unsigned int layerIndex);
133 void ParseStandIn(
GraphPtr graph,
unsigned int layerIndex);
134 void ParseStridedSlice(
GraphPtr graph,
unsigned int layerIndex);
135 void ParseSubtraction(
GraphPtr graph,
unsigned int layerIndex);
136 void ParseSwitch(
GraphPtr graph,
unsigned int layerIndex);
137 void ParseTranspose(
GraphPtr graph,
unsigned int layerIndex);
138 void ParseTransposeConvolution2d(
GraphPtr graph,
unsigned int layerIndex);
140 void RegisterInputSlots(
GraphPtr graph, uint32_t layerIndex,
142 void RegisterOutputSlots(
GraphPtr graph, uint32_t layerIndex,
146 void RegisterOutputSlotOfConnection(uint32_t sourceLayerIndex, uint32_t outputSlotIndex,
armnn::IOutputSlot* slot);
147 void RegisterInputSlotOfConnection(uint32_t sourceLayerIndex, uint32_t outputSlotIndex,
armnn::IInputSlot* slot);
151 void SetupInputLayers(
GraphPtr graphPtr);
152 void SetupOutputLayers(
GraphPtr graphPtr);
155 unsigned int GetInputLayerInVector(
GraphPtr graph,
int targetId);
156 unsigned int GetOutputLayerInVector(
GraphPtr graph,
int targetId);
159 unsigned int GetLayerIndexInVector(
GraphPtr graph,
unsigned int index);
161 struct FeatureVersions
164 unsigned int m_BindingIdScheme = 0;
167 FeatureVersions GetFeatureVersions(
GraphPtr graph);
171 std::vector<LayerParsingFunction> m_ParserFunctions;
173 using NameToBindingInfo = std::pair<std::string, BindingPointInfo >;
174 std::vector<NameToBindingInfo> m_InputBindings;
175 std::vector<NameToBindingInfo> m_OutputBindings;
181 std::unordered_map<unsigned int, armnn::IOutputSlot*> outputSlots;
184 std::unordered_map<unsigned int, std::vector<armnn::IInputSlot*>> inputSlots;
188 std::unordered_map<unsigned int, Connections> m_GraphConnections;
static armnn::NormalizationDescriptor GetNormalizationDescriptor(NormalizationDescriptorPtr normalizationDescriptor, unsigned int layerIndex)
static TensorRawPtrVector GetOutputs(const GraphPtr &graph, unsigned int layerIndex)
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
static LayerBaseRawPtr GetBaseLayer(const GraphPtr &graphPtr, unsigned int layerIndex)
const armnnSerializer::ConstTensor * ConstTensorRawPtr
const armnnSerializer::NormalizationDescriptor * NormalizationDescriptorPtr
static GraphPtr LoadGraphFromBinary(const uint8_t *binaryContent, size_t len)
const armnnSerializer::QLstmDescriptor * QLstmDescriptorPtr
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 ...
armnn::INetworkPtr CreateNetworkFromBinary(const std::vector< uint8_t > &binaryContent)
Create an input network from binary file contents.
std::vector< LayerBaseRawPtr > LayerBaseRawPtrVector
const armnnSerializer::SerializedGraph * GraphPtr
static int32_t GetBindingLayerInfo(const GraphPtr &graphPtr, unsigned int layerIndex)
const armnnSerializer::LayerBase * LayerBaseRawPtr
std::vector< TensorRawPtr > TensorRawPtrVector
DeserializerImpl & operator=(const DeserializerImpl &)=delete
const armnnSerializer::QuantizedLstmInputParams * QunatizedLstmInputParamsPtr
const armnnSerializer::LstmDescriptor * LstmDescriptorPtr
static armnn::LstmDescriptor GetLstmDescriptor(LstmDescriptorPtr lstmDescriptor)
An LstmDescriptor for the LstmLayer.
An output connection slot for a layer.
static TensorRawPtrVector GetInputs(const GraphPtr &graph, unsigned int layerIndex)
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...
static armnn::Pooling2dDescriptor GetPoolingDescriptor(PoolingDescriptor pooling2dDescriptor, unsigned int layerIndex)
A QLstmDescriptor for the QLstmLayer.
static armnn::LstmInputParams GetLstmInputParams(LstmDescriptorPtr lstmDescriptor, LstmInputParamsPtr lstmInputParams)
const armnnSerializer::TensorInfo * TensorRawPtr
~DeserializerImpl()=default
static std::string GetLayerName(const GraphPtr &graph, unsigned int index)
static armnn::QLstmDescriptor GetQLstmDescriptor(QLstmDescriptorPtr qLstmDescriptorPtr)
static armnn::TensorInfo OutputShapeOfReshape(const armnn::TensorInfo &inputTensorInfo, const std::vector< uint32_t > &targetDimsIn)
const armnnSerializer::LayerBase * LayerRawPtr
std::unique_ptr< INetwork, void(*)(INetwork *network)> INetworkPtr
A Pooling2dDescriptor for the Pooling2dLayer.
A NormalizationDescriptor for the NormalizationLayer.
const armnnSerializer::LstmInputParams * LstmInputParamsPtr
const armnnSerializer::Pooling2dDescriptor * PoolingDescriptor