10 #include <ArmnnSchema_generated.h> 12 #include <unordered_map> 21 using GraphPtr =
const armnnSerializer::SerializedGraph *;
59 unsigned int layerIndex);
66 const std::vector<uint32_t> & targetDimsIn);
79 void ParseUnsupportedLayer(
GraphPtr graph,
unsigned int layerIndex);
80 void ParseAbs(
GraphPtr graph,
unsigned int layerIndex);
81 void ParseActivation(
GraphPtr graph,
unsigned int layerIndex);
82 void ParseAdd(
GraphPtr graph,
unsigned int layerIndex);
83 void ParseArgMinMax(
GraphPtr graph,
unsigned int layerIndex);
84 void ParseBatchToSpaceNd(
GraphPtr graph,
unsigned int layerIndex);
85 void ParseBatchNormalization(
GraphPtr graph,
unsigned int layerIndex);
86 void ParseComparison(
GraphPtr graph,
unsigned int layerIndex);
87 void ParseConcat(
GraphPtr graph,
unsigned int layerIndex);
88 void ParseConstant(
GraphPtr graph,
unsigned int layerIndex);
89 void ParseConvolution2d(
GraphPtr graph,
unsigned int layerIndex);
90 void ParseDepthToSpace(
GraphPtr graph,
unsigned int layerIndex);
91 void ParseDepthwiseConvolution2d(
GraphPtr graph,
unsigned int layerIndex);
92 void ParseDequantize(
GraphPtr graph,
unsigned int layerIndex);
93 void ParseDetectionPostProcess(
GraphPtr graph,
unsigned int layerIndex);
94 void ParseDivision(
GraphPtr graph,
unsigned int layerIndex);
95 void ParseElementwiseUnary(
GraphPtr graph,
unsigned int layerIndex);
96 void ParseEqual(
GraphPtr graph,
unsigned int layerIndex);
97 void ParseFloor(
GraphPtr graph,
unsigned int layerIndex);
98 void ParseFullyConnected(
GraphPtr graph,
unsigned int layerIndex);
99 void ParseGather(
GraphPtr graph,
unsigned int layerIndex);
100 void ParseGreater(
GraphPtr graph,
unsigned int layerIndex);
101 void ParseInstanceNormalization(
GraphPtr graph,
unsigned int layerIndex);
102 void ParseL2Normalization(
GraphPtr graph,
unsigned int layerIndex);
103 void ParseLogSoftmax(
GraphPtr graph,
unsigned int layerIndex);
104 void ParseMaximum(
GraphPtr graph,
unsigned int layerIndex);
105 void ParseMean(
GraphPtr graph,
unsigned int layerIndex);
106 void ParseMinimum(
GraphPtr graph,
unsigned int layerIndex);
107 void ParseMerge(
GraphPtr graph,
unsigned int layerIndex);
108 void ParseMultiplication(
GraphPtr graph,
unsigned int layerIndex);
109 void ParseNormalization(
GraphPtr graph,
unsigned int layerIndex);
110 void ParseLstm(
GraphPtr graph,
unsigned int layerIndex);
111 void ParseQuantizedLstm(
GraphPtr graph,
unsigned int layerIndex);
112 void ParsePad(
GraphPtr graph,
unsigned int layerIndex);
113 void ParsePermute(
GraphPtr graph,
unsigned int layerIndex);
114 void ParsePooling2d(
GraphPtr graph,
unsigned int layerIndex);
115 void ParsePrelu(
GraphPtr graph,
unsigned int layerIndex);
116 void ParseQuantize(
GraphPtr graph,
unsigned int layerIndex);
117 void ParseReshape(
GraphPtr graph,
unsigned int layerIndex);
118 void ParseResize(
GraphPtr graph,
unsigned int layerIndex);
119 void ParseResizeBilinear(
GraphPtr graph,
unsigned int layerIndex);
120 void ParseRsqrt(
GraphPtr graph,
unsigned int layerIndex);
121 void ParseSlice(
GraphPtr graph,
unsigned int layerIndex);
122 void ParseSoftmax(
GraphPtr graph,
unsigned int layerIndex);
123 void ParseSpaceToBatchNd(
GraphPtr graph,
unsigned int layerIndex);
124 void ParseSpaceToDepth(
GraphPtr graph,
unsigned int layerIndex);
125 void ParseSplitter(
GraphPtr graph,
unsigned int layerIndex);
126 void ParseStack(
GraphPtr graph,
unsigned int layerIndex);
127 void ParseStandIn(
GraphPtr graph,
unsigned int layerIndex);
128 void ParseStridedSlice(
GraphPtr graph,
unsigned int layerIndex);
129 void ParseSubtraction(
GraphPtr graph,
unsigned int layerIndex);
130 void ParseSwitch(
GraphPtr graph,
unsigned int layerIndex);
131 void ParseTransposeConvolution2d(
GraphPtr graph,
unsigned int layerIndex);
133 void RegisterInputSlots(
GraphPtr graph, uint32_t layerIndex,
135 void RegisterOutputSlots(
GraphPtr graph, uint32_t layerIndex,
139 void RegisterOutputSlotOfConnection(uint32_t sourceLayerIndex, uint32_t outputSlotIndex,
armnn::IOutputSlot* slot);
140 void RegisterInputSlotOfConnection(uint32_t sourceLayerIndex, uint32_t outputSlotIndex,
armnn::IInputSlot* slot);
144 void SetupInputLayers(
GraphPtr graphPtr);
145 void SetupOutputLayers(
GraphPtr graphPtr);
148 unsigned int GetInputLayerInVector(
GraphPtr graph,
int targetId);
149 unsigned int GetOutputLayerInVector(
GraphPtr graph,
int targetId);
152 unsigned int GetLayerIndexInVector(
GraphPtr graph,
unsigned int index);
154 struct FeatureVersions
157 unsigned int m_BindingIdScheme = 0;
160 FeatureVersions GetFeatureVersions(
GraphPtr graph);
164 std::vector<LayerParsingFunction> m_ParserFunctions;
166 using NameToBindingInfo = std::pair<std::string, BindingPointInfo >;
167 std::vector<NameToBindingInfo> m_InputBindings;
168 std::vector<NameToBindingInfo> m_OutputBindings;
174 std::unordered_map<unsigned int, armnn::IOutputSlot*> outputSlots;
177 std::unordered_map<unsigned int, std::vector<armnn::IInputSlot*>> inputSlots;
181 std::unordered_map<unsigned int, Connections> m_GraphConnections;
armnn::INetworkPtr CreateNetworkFromBinary(const std::vector< uint8_t > &binaryContent) override
Create an input network from binary file contents.
static std::string GetLayerName(const GraphPtr &graph, unsigned int index)
A NormalizationDescriptor for the NormalizationLayer.
static armnn::TensorInfo OutputShapeOfReshape(const armnn::TensorInfo &inputTensorInfo, const std::vector< uint32_t > &targetDimsIn)
static armnn::Pooling2dDescriptor GetPoolingDescriptor(PoolingDescriptor pooling2dDescriptor, unsigned int layerIndex)
BindingPointInfo GetNetworkInputBindingInfo(unsigned int layerId, const std::string &name) const override
Retrieve binding info (layer id and tensor info) for the network input identified by the given layer ...
std::vector< TensorRawPtr > TensorRawPtrVector
const armnnSerializer::LstmDescriptor * LstmDescriptorPtr
const armnnSerializer::SerializedGraph * GraphPtr
static LayerBaseRawPtr GetBaseLayer(const GraphPtr &graphPtr, unsigned int layerIndex)
static TensorRawPtrVector GetOutputs(const GraphPtr &graph, unsigned int layerIndex)
static GraphPtr LoadGraphFromBinary(const uint8_t *binaryContent, size_t len)
std::vector< LayerBaseRawPtr > LayerBaseRawPtrVector
const armnnSerializer::ConstTensor * ConstTensorRawPtr
const armnnSerializer::LayerBase * LayerBaseRawPtr
An LstmDescriptor for the LstmLayer.
const armnnSerializer::NormalizationDescriptor * NormalizationDescriptorPtr
static armnn::NormalizationDescriptor GetNormalizationDescriptor(NormalizationDescriptorPtr normalizationDescriptor, unsigned int layerIndex)
std::unique_ptr< INetwork, void(*)(INetwork *network)> INetworkPtr
const armnnSerializer::Pooling2dDescriptor * PoolingDescriptor
An output connection slot for a layer. The output slot may be connected to 1 or more input slots of s...
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
BindingPointInfo GetNetworkOutputBindingInfo(unsigned int layerId, const std::string &name) const override
Retrieve binding info (layer id and tensor info) for the network output identified by the given layer...
A Pooling2dDescriptor for the Pooling2dLayer.
const armnnSerializer::TensorInfo * TensorRawPtr
static TensorRawPtrVector GetInputs(const GraphPtr &graph, unsigned int layerIndex)
static armnn::LstmDescriptor GetLstmDescriptor(LstmDescriptorPtr lstmDescriptor)
const armnnSerializer::LayerBase * LayerRawPtr
const armnnSerializer::QuantizedLstmInputParams * QunatizedLstmInputParamsPtr
const armnnSerializer::LstmInputParams * LstmInputParamsPtr
static armnn::LstmInputParams GetLstmInputParams(LstmDescriptorPtr lstmDescriptor, LstmInputParamsPtr lstmInputParams)
static int32_t GetBindingLayerInfo(const GraphPtr &graphPtr, unsigned int layerIndex)