24.08
|
Go to the documentation of this file.
10 #include <ArmnnSchema_generated.h>
12 #include <unordered_map>
19 using GraphPtr =
const armnnSerializer::SerializedGraph *;
65 unsigned int layerIndex);
67 unsigned int layerIndex);
77 const std::vector<uint32_t> & targetDimsIn);
86 void ParseUnsupportedLayer(
GraphPtr graph,
unsigned int layerIndex);
87 void ParseAbs(
GraphPtr graph,
unsigned int layerIndex);
88 void ParseActivation(
GraphPtr graph,
unsigned int layerIndex);
89 void ParseAdd(
GraphPtr graph,
unsigned int layerIndex);
90 void ParseArgMinMax(
GraphPtr graph,
unsigned int layerIndex);
91 void ParseBatchMatMul(
GraphPtr graph,
unsigned int layerIndex);
92 void ParseBatchToSpaceNd(
GraphPtr graph,
unsigned int layerIndex);
93 void ParseBatchNormalization(
GraphPtr graph,
unsigned int layerIndex);
94 void ParseCast(
GraphPtr graph,
unsigned int layerIndex);
95 void ParseChannelShuffle(
GraphPtr graph,
unsigned int layerIndex);
96 void ParseComparison(
GraphPtr graph,
unsigned int layerIndex);
97 void ParseConcat(
GraphPtr graph,
unsigned int layerIndex);
98 void ParseConstant(
GraphPtr graph,
unsigned int layerIndex);
99 void ParseConvolution2d(
GraphPtr graph,
unsigned int layerIndex);
100 void ParseConvolution3d(
GraphPtr graph,
unsigned int layerIndex);
101 void ParseDepthToSpace(
GraphPtr graph,
unsigned int layerIndex);
102 void ParseDepthwiseConvolution2d(
GraphPtr graph,
unsigned int layerIndex);
103 void ParseDequantize(
GraphPtr graph,
unsigned int layerIndex);
104 void ParseDetectionPostProcess(
GraphPtr graph,
unsigned int layerIndex);
105 void ParseDivision(
GraphPtr graph,
unsigned int layerIndex);
106 void ParseElementwiseBinary(
GraphPtr graph,
unsigned int layerIndex);
107 void ParseElementwiseUnary(
GraphPtr graph,
unsigned int layerIndex);
108 void ParseEqual(
GraphPtr graph,
unsigned int layerIndex);
109 void ParseFill(
GraphPtr graph,
unsigned int layerIndex);
110 void ParseFloor(
GraphPtr graph,
unsigned int layerIndex);
111 void ParseFullyConnected(
GraphPtr graph,
unsigned int layerIndex);
112 void ParseGather(
GraphPtr graph,
unsigned int layerIndex);
113 void ParseGatherNd(
GraphPtr graph,
unsigned int layerIndex);
114 void ParseGreater(
GraphPtr graph,
unsigned int layerIndex);
115 void ParseInstanceNormalization(
GraphPtr graph,
unsigned int layerIndex);
116 void ParseL2Normalization(
GraphPtr graph,
unsigned int layerIndex);
117 void ParseLogicalBinary(
GraphPtr graph,
unsigned int layerIndex);
118 void ParseLogSoftmax(
GraphPtr graph,
unsigned int layerIndex);
119 void ParseMaximum(
GraphPtr graph,
unsigned int layerIndex);
120 void ParseMean(
GraphPtr graph,
unsigned int layerIndex);
121 void ParseMinimum(
GraphPtr graph,
unsigned int layerIndex);
122 void ParseMerge(
GraphPtr graph,
unsigned int layerIndex);
123 void ParseMultiplication(
GraphPtr graph,
unsigned int layerIndex);
124 void ParseNormalization(
GraphPtr graph,
unsigned int layerIndex);
125 void ParseLstm(
GraphPtr graph,
unsigned int layerIndex);
126 void ParseQuantizedLstm(
GraphPtr graph,
unsigned int layerIndex);
127 void ParsePad(
GraphPtr graph,
unsigned int layerIndex);
128 void ParsePermute(
GraphPtr graph,
unsigned int layerIndex);
129 void ParsePooling2d(
GraphPtr graph,
unsigned int layerIndex);
130 void ParsePooling3d(
GraphPtr graph,
unsigned int layerIndex);
131 void ParsePrelu(
GraphPtr graph,
unsigned int layerIndex);
132 void ParseQLstm(
GraphPtr graph,
unsigned int layerIndex);
133 void ParseQuantize(
GraphPtr graph,
unsigned int layerIndex);
134 void ParseRank(
GraphPtr graph,
unsigned int layerIndex);
135 void ParseReduce(
GraphPtr graph,
unsigned int layerIndex);
136 void ParseReshape(
GraphPtr graph,
unsigned int layerIndex);
137 void ParseResize(
GraphPtr graph,
unsigned int layerIndex);
138 void ParseResizeBilinear(
GraphPtr graph,
unsigned int layerIndex);
139 void ParseReverseV2(
GraphPtr graph,
unsigned int layerIndex);
140 void ParseRsqrt(
GraphPtr graph,
unsigned int layerIndex);
141 void ParseScatterNd(
GraphPtr graph,
unsigned int layerIndex);
142 void ParseShape(
GraphPtr graph,
unsigned int layerIndex);
143 void ParseSlice(
GraphPtr graph,
unsigned int layerIndex);
144 void ParseSoftmax(
GraphPtr graph,
unsigned int layerIndex);
145 void ParseSpaceToBatchNd(
GraphPtr graph,
unsigned int layerIndex);
146 void ParseSpaceToDepth(
GraphPtr graph,
unsigned int layerIndex);
147 void ParseSplitter(
GraphPtr graph,
unsigned int layerIndex);
148 void ParseStack(
GraphPtr graph,
unsigned int layerIndex);
149 void ParseStandIn(
GraphPtr graph,
unsigned int layerIndex);
150 void ParseStridedSlice(
GraphPtr graph,
unsigned int layerIndex);
151 void ParseSubtraction(
GraphPtr graph,
unsigned int layerIndex);
152 void ParseSwitch(
GraphPtr graph,
unsigned int layerIndex);
153 void ParseTile(
GraphPtr graph,
unsigned int layerIndex);
154 void ParseTranspose(
GraphPtr graph,
unsigned int layerIndex);
155 void ParseTransposeConvolution2d(
GraphPtr graph,
unsigned int layerIndex);
156 void ParseUnidirectionalSequenceLstm(
GraphPtr graph,
unsigned int layerIndex);
158 void RegisterInputSlots(
GraphPtr graph,
161 std::vector<unsigned int> ignoreSlots = {});
162 void RegisterOutputSlots(
GraphPtr graph,
167 void RegisterOutputSlotOfConnection(uint32_t sourceLayerIndex, uint32_t outputSlotIndex,
armnn::IOutputSlot* slot);
168 void RegisterInputSlotOfConnection(uint32_t sourceLayerIndex, uint32_t outputSlotIndex,
armnn::IInputSlot* slot);
172 void SetupInputLayers(
GraphPtr graphPtr);
173 void SetupOutputLayers(
GraphPtr graphPtr);
176 unsigned int GetInputLayerInVector(
GraphPtr graph,
int targetId);
177 unsigned int GetOutputLayerInVector(
GraphPtr graph,
int targetId);
180 unsigned int GetLayerIndexInVector(
GraphPtr graph,
unsigned int index);
182 struct FeatureVersions
185 unsigned int m_BindingIdScheme = 0;
188 unsigned int m_WeightsLayoutScheme = 0;
191 unsigned int m_ConstTensorsAsInputs = 0;
194 FeatureVersions GetFeatureVersions(
GraphPtr graph);
198 std::vector<LayerParsingFunction> m_ParserFunctions;
200 using NameToBindingInfo = std::pair<std::string, BindingPointInfo >;
201 std::vector<NameToBindingInfo> m_InputBindings;
202 std::vector<NameToBindingInfo> m_OutputBindings;
208 std::unordered_map<unsigned int, armnn::IOutputSlot*> outputSlots;
211 std::unordered_map<unsigned int, std::vector<armnn::IInputSlot*>> inputSlots;
215 std::unordered_map<unsigned int, Connections> m_GraphConnections;
std::unique_ptr< INetwork, void(*)(INetwork *network)> INetworkPtr
const armnnSerializer::TensorInfo * TensorRawPtr
static int32_t GetBindingLayerInfo(const GraphPtr &graphPtr, unsigned int layerIndex)
A QLstmDescriptor for the QLstmLayer.
static TensorRawPtrVector GetInputs(const GraphPtr &graph, unsigned int layerIndex)
A Pooling3dDescriptor for the Pooling3dLayer.
const armnnSerializer::LstmDescriptor * LstmDescriptorPtr
armnn::INetworkPtr CreateNetworkFromBinary(const std::vector< uint8_t > &binaryContent)
Create an input network from binary file contents.
LstmDescriptor UnidirectionalSequenceLstmDescriptor
~DeserializerImpl()=default
const armnnSerializer::QuantizedLstmInputParams * QunatizedLstmInputParamsPtr
A NormalizationDescriptor for the NormalizationLayer.
static armnn::QLstmDescriptor GetQLstmDescriptor(QLstmDescriptorPtr qLstmDescriptorPtr)
const armnnSerializer::UnidirectionalSequenceLstmDescriptor * UnidirectionalSequenceLstmDescriptorPtr
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 ...
const armnnSerializer::LayerBase * LayerBaseRawPtr
An output connection slot for a layer.
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 TensorRawPtrVector GetOutputs(const GraphPtr &graph, unsigned int layerIndex)
static armnn::Pooling3dDescriptor GetPooling3dDescriptor(Pooling3dDescriptor pooling3dDescriptor, unsigned int layerIndex)
static armnn::TensorInfo OutputShapeOfReshape(const armnn::TensorInfo &inputTensorInfo, const std::vector< uint32_t > &targetDimsIn)
const armnnSerializer::NormalizationDescriptor * NormalizationDescriptorPtr
std::vector< LayerBaseRawPtr > LayerBaseRawPtrVector
const armnnSerializer::LayerBase * LayerRawPtr
static armnn::NormalizationDescriptor GetNormalizationDescriptor(NormalizationDescriptorPtr normalizationDescriptor, unsigned int layerIndex)
std::vector< TensorRawPtr > TensorRawPtrVector
static armnn::Pooling2dDescriptor GetPooling2dDescriptor(Pooling2dDescriptor pooling2dDescriptor, unsigned int layerIndex)
static armnn::LstmDescriptor GetLstmDescriptor(LstmDescriptorPtr lstmDescriptor)
static GraphPtr LoadGraphFromBinary(const uint8_t *binaryContent, size_t len)
static armnn::LstmInputParams GetLstmInputParams(LstmDescriptorPtr lstmDescriptor, LstmInputParamsPtr lstmInputParams)
const armnnSerializer::QLstmDescriptor * QLstmDescriptorPtr
An LstmDescriptor for the LstmLayer.
DeserializerImpl & operator=(const DeserializerImpl &)=delete
const armnnSerializer::Pooling3dDescriptor * Pooling3dDescriptor
const armnnSerializer::ConstTensor * ConstTensorRawPtr
static LayerBaseRawPtr GetBaseLayer(const GraphPtr &graphPtr, unsigned int layerIndex)
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
static std::string GetLayerName(const GraphPtr &graph, unsigned int index)
static armnn::UnidirectionalSequenceLstmDescriptor GetUnidirectionalSequenceLstmDescriptor(UnidirectionalSequenceLstmDescriptorPtr descriptor)
A Pooling2dDescriptor for the Pooling2dLayer.
const armnnSerializer::Pooling2dDescriptor * Pooling2dDescriptor
const armnnSerializer::SerializedGraph * GraphPtr
const armnnSerializer::LstmInputParams * LstmInputParamsPtr