ArmNN
 23.02
IDeserializer::DeserializerImpl Class Reference

#include <Deserializer.hpp>

Public Member Functions

armnn::INetworkPtr CreateNetworkFromBinary (const std::vector< uint8_t > &binaryContent)
 Create an input network from binary file contents. More...
 
armnn::INetworkPtr CreateNetworkFromBinary (std::istream &binaryContent)
 Create an input network from a binary input stream. More...
 
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 name. More...
 
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 name. More...
 
 DeserializerImpl ()
 
 ~DeserializerImpl ()=default
 
 DeserializerImpl (const DeserializerImpl &)=delete
 
DeserializerImploperator= (const DeserializerImpl &)=delete
 

Static Public Member Functions

static GraphPtr LoadGraphFromBinary (const uint8_t *binaryContent, size_t len)
 
static TensorRawPtrVector GetInputs (const GraphPtr &graph, unsigned int layerIndex)
 
static TensorRawPtrVector GetOutputs (const GraphPtr &graph, unsigned int layerIndex)
 
static LayerBaseRawPtr GetBaseLayer (const GraphPtr &graphPtr, unsigned int layerIndex)
 
static int32_t GetBindingLayerInfo (const GraphPtr &graphPtr, unsigned int layerIndex)
 
static std::string GetLayerName (const GraphPtr &graph, unsigned int index)
 
static armnn::Pooling2dDescriptor GetPooling2dDescriptor (Pooling2dDescriptor pooling2dDescriptor, unsigned int layerIndex)
 
static armnn::Pooling3dDescriptor GetPooling3dDescriptor (Pooling3dDescriptor pooling3dDescriptor, unsigned int layerIndex)
 
static armnn::NormalizationDescriptor GetNormalizationDescriptor (NormalizationDescriptorPtr normalizationDescriptor, unsigned int layerIndex)
 
static armnn::LstmDescriptor GetLstmDescriptor (LstmDescriptorPtr lstmDescriptor)
 
static armnn::LstmInputParams GetLstmInputParams (LstmDescriptorPtr lstmDescriptor, LstmInputParamsPtr lstmInputParams)
 
static armnn::QLstmDescriptor GetQLstmDescriptor (QLstmDescriptorPtr qLstmDescriptorPtr)
 
static armnn::UnidirectionalSequenceLstmDescriptor GetUnidirectionalSequenceLstmDescriptor (UnidirectionalSequenceLstmDescriptorPtr descriptor)
 
static armnn::TensorInfo OutputShapeOfReshape (const armnn::TensorInfo &inputTensorInfo, const std::vector< uint32_t > &targetDimsIn)
 

Detailed Description

Definition at line 34 of file Deserializer.hpp.

Constructor & Destructor Documentation

◆ DeserializerImpl() [1/2]

Definition at line 207 of file Deserializer.cpp.

208 : m_Network(nullptr, nullptr),
209 //May require LayerType_Max to be included
210 m_ParserFunctions(Layer_MAX+1, &IDeserializer::DeserializerImpl::ParseUnsupportedLayer)
211 {
212  // register supported layers
213  m_ParserFunctions[Layer_AbsLayer] = &DeserializerImpl::ParseAbs;
214  m_ParserFunctions[Layer_ActivationLayer] = &DeserializerImpl::ParseActivation;
215  m_ParserFunctions[Layer_AdditionLayer] = &DeserializerImpl::ParseAdd;
216  m_ParserFunctions[Layer_ArgMinMaxLayer] = &DeserializerImpl::ParseArgMinMax;
217  m_ParserFunctions[Layer_BatchMatMulLayer] = &DeserializerImpl::ParseBatchMatMul;
218  m_ParserFunctions[Layer_BatchToSpaceNdLayer] = &DeserializerImpl::ParseBatchToSpaceNd;
219  m_ParserFunctions[Layer_BatchNormalizationLayer] = &DeserializerImpl::ParseBatchNormalization;
220  m_ParserFunctions[Layer_CastLayer] = &DeserializerImpl::ParseCast;
221  m_ParserFunctions[Layer_ChannelShuffleLayer] = &DeserializerImpl::ParseChannelShuffle;
222  m_ParserFunctions[Layer_ComparisonLayer] = &DeserializerImpl::ParseComparison;
223  m_ParserFunctions[Layer_ConcatLayer] = &DeserializerImpl::ParseConcat;
224  m_ParserFunctions[Layer_ConstantLayer] = &DeserializerImpl::ParseConstant;
225  m_ParserFunctions[Layer_Convolution2dLayer] = &DeserializerImpl::ParseConvolution2d;
226  m_ParserFunctions[Layer_Convolution3dLayer] = &DeserializerImpl::ParseConvolution3d;
227  m_ParserFunctions[Layer_DepthToSpaceLayer] = &DeserializerImpl::ParseDepthToSpace;
228  m_ParserFunctions[Layer_DepthwiseConvolution2dLayer] = &DeserializerImpl::ParseDepthwiseConvolution2d;
229  m_ParserFunctions[Layer_DequantizeLayer] = &DeserializerImpl::ParseDequantize;
230  m_ParserFunctions[Layer_DetectionPostProcessLayer] = &DeserializerImpl::ParseDetectionPostProcess;
231  m_ParserFunctions[Layer_DivisionLayer] = &DeserializerImpl::ParseDivision;
232  m_ParserFunctions[Layer_ElementwiseUnaryLayer] = &DeserializerImpl::ParseElementwiseUnary;
233  m_ParserFunctions[Layer_EqualLayer] = &DeserializerImpl::ParseEqual;
234  m_ParserFunctions[Layer_FullyConnectedLayer] = &DeserializerImpl::ParseFullyConnected;
235  m_ParserFunctions[Layer_FillLayer] = &DeserializerImpl::ParseFill;
236  m_ParserFunctions[Layer_FloorLayer] = &DeserializerImpl::ParseFloor;
237  m_ParserFunctions[Layer_GatherLayer] = &DeserializerImpl::ParseGather;
238  m_ParserFunctions[Layer_GatherNdLayer] = &DeserializerImpl::ParseGatherNd;
239  m_ParserFunctions[Layer_GreaterLayer] = &DeserializerImpl::ParseGreater;
240  m_ParserFunctions[Layer_InstanceNormalizationLayer] = &DeserializerImpl::ParseInstanceNormalization;
241  m_ParserFunctions[Layer_L2NormalizationLayer] = &DeserializerImpl::ParseL2Normalization;
242  m_ParserFunctions[Layer_LogicalBinaryLayer] = &DeserializerImpl::ParseLogicalBinary;
243  m_ParserFunctions[Layer_LogSoftmaxLayer] = &DeserializerImpl::ParseLogSoftmax;
244  m_ParserFunctions[Layer_LstmLayer] = &DeserializerImpl::ParseLstm;
245  m_ParserFunctions[Layer_MaximumLayer] = &DeserializerImpl::ParseMaximum;
246  m_ParserFunctions[Layer_MeanLayer] = &DeserializerImpl::ParseMean;
247  m_ParserFunctions[Layer_MinimumLayer] = &DeserializerImpl::ParseMinimum;
248  m_ParserFunctions[Layer_MergeLayer] = &DeserializerImpl::ParseMerge;
249  m_ParserFunctions[Layer_MergerLayer] = &DeserializerImpl::ParseConcat;
250  m_ParserFunctions[Layer_MultiplicationLayer] = &DeserializerImpl::ParseMultiplication;
251  m_ParserFunctions[Layer_NormalizationLayer] = &DeserializerImpl::ParseNormalization;
252  m_ParserFunctions[Layer_PadLayer] = &DeserializerImpl::ParsePad;
253  m_ParserFunctions[Layer_PermuteLayer] = &DeserializerImpl::ParsePermute;
254  m_ParserFunctions[Layer_Pooling2dLayer] = &DeserializerImpl::ParsePooling2d;
255  m_ParserFunctions[Layer_Pooling3dLayer] = &DeserializerImpl::ParsePooling3d;
256  m_ParserFunctions[Layer_PreluLayer] = &DeserializerImpl::ParsePrelu;
257  m_ParserFunctions[Layer_QLstmLayer] = &DeserializerImpl::ParseQLstm;
258  m_ParserFunctions[Layer_QuantizeLayer] = &DeserializerImpl::ParseQuantize;
259  m_ParserFunctions[Layer_QuantizedLstmLayer] = &DeserializerImpl::ParseQuantizedLstm;
260  m_ParserFunctions[Layer_RankLayer] = &DeserializerImpl::ParseRank;
261  m_ParserFunctions[Layer_ReduceLayer] = &DeserializerImpl::ParseReduce;
262  m_ParserFunctions[Layer_ReshapeLayer] = &DeserializerImpl::ParseReshape;
263  m_ParserFunctions[Layer_ResizeBilinearLayer] = &DeserializerImpl::ParseResizeBilinear;
264  m_ParserFunctions[Layer_ResizeLayer] = &DeserializerImpl::ParseResize;
265  m_ParserFunctions[Layer_RsqrtLayer] = &DeserializerImpl::ParseRsqrt;
266  m_ParserFunctions[Layer_ShapeLayer] = &DeserializerImpl::ParseShape;
267  m_ParserFunctions[Layer_SliceLayer] = &DeserializerImpl::ParseSlice;
268  m_ParserFunctions[Layer_SoftmaxLayer] = &DeserializerImpl::ParseSoftmax;
269  m_ParserFunctions[Layer_SpaceToBatchNdLayer] = &DeserializerImpl::ParseSpaceToBatchNd;
270  m_ParserFunctions[Layer_SpaceToDepthLayer] = &DeserializerImpl::ParseSpaceToDepth;
271  m_ParserFunctions[Layer_SplitterLayer] = &DeserializerImpl::ParseSplitter;
272  m_ParserFunctions[Layer_StackLayer] = &DeserializerImpl::ParseStack;
273  m_ParserFunctions[Layer_StandInLayer] = &DeserializerImpl::ParseStandIn;
274  m_ParserFunctions[Layer_StridedSliceLayer] = &DeserializerImpl::ParseStridedSlice;
275  m_ParserFunctions[Layer_SubtractionLayer] = &DeserializerImpl::ParseSubtraction;
276  m_ParserFunctions[Layer_SwitchLayer] = &DeserializerImpl::ParseSwitch;
277  m_ParserFunctions[Layer_TransposeConvolution2dLayer] = &DeserializerImpl::ParseTransposeConvolution2d;
278  m_ParserFunctions[Layer_TransposeLayer] = &DeserializerImpl::ParseTranspose;
279  m_ParserFunctions[Layer_UnidirectionalSequenceLstmLayer] = &DeserializerImpl::ParseUnidirectionalSequenceLstm;
280 }

◆ ~DeserializerImpl()

~DeserializerImpl ( )
default

◆ DeserializerImpl() [2/2]

DeserializerImpl ( const DeserializerImpl )
delete

Member Function Documentation

◆ CreateNetworkFromBinary() [1/2]

INetworkPtr CreateNetworkFromBinary ( const std::vector< uint8_t > &  binaryContent)

Create an input network from binary file contents.

Definition at line 816 of file Deserializer.cpp.

817 {
818  ResetParser();
819  GraphPtr graph = LoadGraphFromBinary(binaryContent.data(), binaryContent.size());
820  return CreateNetworkFromGraph(graph);
821 }

◆ CreateNetworkFromBinary() [2/2]

armnn::INetworkPtr CreateNetworkFromBinary ( std::istream &  binaryContent)

Create an input network from a binary input stream.

Definition at line 823 of file Deserializer.cpp.

824 {
825  ResetParser();
826  if (binaryContent.fail()) {
827  ARMNN_LOG(error) << (std::string("Cannot read input"));
828  throw ParseException("Unable to read Input stream data");
829  }
830  binaryContent.seekg(0, std::ios::end);
831  const std::streamoff size = binaryContent.tellg();
832  std::vector<char> content(static_cast<size_t>(size));
833  binaryContent.seekg(0);
834  binaryContent.read(content.data(), static_cast<std::streamsize>(size));
835  GraphPtr graph = LoadGraphFromBinary(reinterpret_cast<uint8_t*>(content.data()), static_cast<size_t>(size));
836  return CreateNetworkFromGraph(graph);
837 }

References ARMNN_LOG, and armnn::error.

◆ GetBaseLayer()

LayerBaseRawPtr GetBaseLayer ( const GraphPtr graphPtr,
unsigned int  layerIndex 
)
static

Definition at line 282 of file Deserializer.cpp.

283 {
284  auto layerType = graphPtr->layers()->Get(layerIndex)->layer_type();
285 
286  switch(layerType)
287  {
288  case Layer::Layer_AbsLayer:
289  return graphPtr->layers()->Get(layerIndex)->layer_as_AbsLayer()->base();
290  case Layer::Layer_ActivationLayer:
291  return graphPtr->layers()->Get(layerIndex)->layer_as_ActivationLayer()->base();
292  case Layer::Layer_AdditionLayer:
293  return graphPtr->layers()->Get(layerIndex)->layer_as_AdditionLayer()->base();
294  case Layer::Layer_ArgMinMaxLayer:
295  return graphPtr->layers()->Get(layerIndex)->layer_as_ArgMinMaxLayer()->base();
296  case Layer::Layer_BatchMatMulLayer:
297  return graphPtr->layers()->Get(layerIndex)->layer_as_BatchMatMulLayer()->base();
298  case Layer::Layer_BatchToSpaceNdLayer:
299  return graphPtr->layers()->Get(layerIndex)->layer_as_BatchToSpaceNdLayer()->base();
300  case Layer::Layer_BatchNormalizationLayer:
301  return graphPtr->layers()->Get(layerIndex)->layer_as_BatchNormalizationLayer()->base();
302  case Layer::Layer_CastLayer:
303  return graphPtr->layers()->Get(layerIndex)->layer_as_CastLayer()->base();
304  case Layer::Layer_ChannelShuffleLayer:
305  return graphPtr->layers()->Get(layerIndex)->layer_as_ChannelShuffleLayer()->base();
306  case Layer::Layer_ComparisonLayer:
307  return graphPtr->layers()->Get(layerIndex)->layer_as_ComparisonLayer()->base();
308  case Layer::Layer_ConcatLayer:
309  return graphPtr->layers()->Get(layerIndex)->layer_as_ConcatLayer()->base();
310  case Layer::Layer_ConstantLayer:
311  return graphPtr->layers()->Get(layerIndex)->layer_as_ConstantLayer()->base();
312  case Layer::Layer_Convolution2dLayer:
313  return graphPtr->layers()->Get(layerIndex)->layer_as_Convolution2dLayer()->base();
314  case Layer::Layer_Convolution3dLayer:
315  return graphPtr->layers()->Get(layerIndex)->layer_as_Convolution3dLayer()->base();
316  case Layer::Layer_DepthToSpaceLayer:
317  return graphPtr->layers()->Get(layerIndex)->layer_as_DepthToSpaceLayer()->base();
318  case Layer::Layer_DepthwiseConvolution2dLayer:
319  return graphPtr->layers()->Get(layerIndex)->layer_as_DepthwiseConvolution2dLayer()->base();
320  case Layer::Layer_DequantizeLayer:
321  return graphPtr->layers()->Get(layerIndex)->layer_as_DequantizeLayer()->base();
322  case Layer::Layer_DetectionPostProcessLayer:
323  return graphPtr->layers()->Get(layerIndex)->layer_as_DetectionPostProcessLayer()->base();
324  case Layer::Layer_DivisionLayer:
325  return graphPtr->layers()->Get(layerIndex)->layer_as_DivisionLayer()->base();
326  case Layer::Layer_EqualLayer:
327  return graphPtr->layers()->Get(layerIndex)->layer_as_EqualLayer()->base();
328  case Layer::Layer_ElementwiseUnaryLayer:
329  return graphPtr->layers()->Get(layerIndex)->layer_as_ElementwiseUnaryLayer()->base();
330  case Layer::Layer_FullyConnectedLayer:
331  return graphPtr->layers()->Get(layerIndex)->layer_as_FullyConnectedLayer()->base();
332  case Layer::Layer_FillLayer:
333  return graphPtr->layers()->Get(layerIndex)->layer_as_FillLayer()->base();
334  case Layer::Layer_FloorLayer:
335  return graphPtr->layers()->Get(layerIndex)->layer_as_FloorLayer()->base();
336  case Layer::Layer_GatherLayer:
337  return graphPtr->layers()->Get(layerIndex)->layer_as_GatherLayer()->base();
338  case Layer::Layer_GatherNdLayer:
339  return graphPtr->layers()->Get(layerIndex)->layer_as_GatherNdLayer()->base();
340  case Layer::Layer_GreaterLayer:
341  return graphPtr->layers()->Get(layerIndex)->layer_as_GreaterLayer()->base();
342  case Layer::Layer_InputLayer:
343  return graphPtr->layers()->Get(layerIndex)->layer_as_InputLayer()->base()->base();
344  case Layer::Layer_InstanceNormalizationLayer:
345  return graphPtr->layers()->Get(layerIndex)->layer_as_InstanceNormalizationLayer()->base();
346  case Layer::Layer_L2NormalizationLayer:
347  return graphPtr->layers()->Get(layerIndex)->layer_as_L2NormalizationLayer()->base();
348  case Layer::Layer_LogicalBinaryLayer:
349  return graphPtr->layers()->Get(layerIndex)->layer_as_LogicalBinaryLayer()->base();
350  case Layer::Layer_LogSoftmaxLayer:
351  return graphPtr->layers()->Get(layerIndex)->layer_as_LogSoftmaxLayer()->base();
352  case Layer::Layer_LstmLayer:
353  return graphPtr->layers()->Get(layerIndex)->layer_as_LstmLayer()->base();
354  case Layer::Layer_MeanLayer:
355  return graphPtr->layers()->Get(layerIndex)->layer_as_MeanLayer()->base();
356  case Layer::Layer_MinimumLayer:
357  return graphPtr->layers()->Get(layerIndex)->layer_as_MinimumLayer()->base();
358  case Layer::Layer_MaximumLayer:
359  return graphPtr->layers()->Get(layerIndex)->layer_as_MaximumLayer()->base();
360  case Layer::Layer_MergeLayer:
361  return graphPtr->layers()->Get(layerIndex)->layer_as_MergeLayer()->base();
362  case Layer::Layer_MergerLayer:
363  return graphPtr->layers()->Get(layerIndex)->layer_as_MergerLayer()->base();
364  case Layer::Layer_MultiplicationLayer:
365  return graphPtr->layers()->Get(layerIndex)->layer_as_MultiplicationLayer()->base();
366  case Layer::Layer_NormalizationLayer:
367  return graphPtr->layers()->Get(layerIndex)->layer_as_NormalizationLayer()->base();
368  case Layer::Layer_OutputLayer:
369  return graphPtr->layers()->Get(layerIndex)->layer_as_OutputLayer()->base()->base();
370  case Layer::Layer_PadLayer:
371  return graphPtr->layers()->Get(layerIndex)->layer_as_PadLayer()->base();
372  case Layer::Layer_PermuteLayer:
373  return graphPtr->layers()->Get(layerIndex)->layer_as_PermuteLayer()->base();
374  case Layer::Layer_Pooling2dLayer:
375  return graphPtr->layers()->Get(layerIndex)->layer_as_Pooling2dLayer()->base();
376  case Layer::Layer_Pooling3dLayer:
377  return graphPtr->layers()->Get(layerIndex)->layer_as_Pooling3dLayer()->base();
378  case Layer::Layer_PreluLayer:
379  return graphPtr->layers()->Get(layerIndex)->layer_as_PreluLayer()->base();
380  case Layer::Layer_QLstmLayer:
381  return graphPtr->layers()->Get(layerIndex)->layer_as_QLstmLayer()->base();
382  case Layer::Layer_QuantizeLayer:
383  return graphPtr->layers()->Get(layerIndex)->layer_as_QuantizeLayer()->base();
384  case Layer::Layer_QuantizedLstmLayer:
385  return graphPtr->layers()->Get(layerIndex)->layer_as_QuantizedLstmLayer()->base();
386  case Layer::Layer_RankLayer:
387  return graphPtr->layers()->Get(layerIndex)->layer_as_RankLayer()->base();
388  case Layer::Layer_ReduceLayer:
389  return graphPtr->layers()->Get(layerIndex)->layer_as_ReduceLayer()->base();
390  case Layer::Layer_ReshapeLayer:
391  return graphPtr->layers()->Get(layerIndex)->layer_as_ReshapeLayer()->base();
392  case Layer::Layer_ResizeBilinearLayer:
393  return graphPtr->layers()->Get(layerIndex)->layer_as_ResizeBilinearLayer()->base();
394  case Layer::Layer_ResizeLayer:
395  return graphPtr->layers()->Get(layerIndex)->layer_as_ResizeLayer()->base();
396  case Layer::Layer_RsqrtLayer:
397  return graphPtr->layers()->Get(layerIndex)->layer_as_RsqrtLayer()->base();
398  case Layer::Layer_ShapeLayer:
399  return graphPtr->layers()->Get(layerIndex)->layer_as_ShapeLayer()->base();
400  case Layer::Layer_SliceLayer:
401  return graphPtr->layers()->Get(layerIndex)->layer_as_SliceLayer()->base();
402  case Layer::Layer_SoftmaxLayer:
403  return graphPtr->layers()->Get(layerIndex)->layer_as_SoftmaxLayer()->base();
404  case Layer::Layer_SpaceToBatchNdLayer:
405  return graphPtr->layers()->Get(layerIndex)->layer_as_SpaceToBatchNdLayer()->base();
406  case Layer::Layer_SpaceToDepthLayer:
407  return graphPtr->layers()->Get(layerIndex)->layer_as_SpaceToDepthLayer()->base();
408  case Layer::Layer_SplitterLayer:
409  return graphPtr->layers()->Get(layerIndex)->layer_as_SplitterLayer()->base();
410  case Layer::Layer_StackLayer:
411  return graphPtr->layers()->Get(layerIndex)->layer_as_StackLayer()->base();
412  case Layer::Layer_StandInLayer:
413  return graphPtr->layers()->Get(layerIndex)->layer_as_StandInLayer()->base();
414  case Layer::Layer_StridedSliceLayer:
415  return graphPtr->layers()->Get(layerIndex)->layer_as_StridedSliceLayer()->base();
416  case Layer::Layer_SubtractionLayer:
417  return graphPtr->layers()->Get(layerIndex)->layer_as_SubtractionLayer()->base();
418  case Layer::Layer_SwitchLayer:
419  return graphPtr->layers()->Get(layerIndex)->layer_as_SwitchLayer()->base();
420  case Layer::Layer_TransposeConvolution2dLayer:
421  return graphPtr->layers()->Get(layerIndex)->layer_as_TransposeConvolution2dLayer()->base();
422  case Layer::Layer_TransposeLayer:
423  return graphPtr->layers()->Get(layerIndex)->layer_as_TransposeLayer()->base();
424  case Layer::Layer_UnidirectionalSequenceLstmLayer:
425  return graphPtr->layers()->Get(layerIndex)->layer_as_UnidirectionalSequenceLstmLayer()->base();
426  case Layer::Layer_NONE:
427  default:
428  throw ParseException(fmt::format("Layer type {} not recognized", layerType));
429  }
430 }

◆ GetBindingLayerInfo()

int32_t GetBindingLayerInfo ( const GraphPtr graphPtr,
unsigned int  layerIndex 
)
static

Definition at line 439 of file Deserializer.cpp.

440 {
441  auto layerType = graphPtr->layers()->Get(layerIndex)->layer_type();
442 
443  if (layerType == Layer::Layer_InputLayer)
444  {
445  return graphPtr->layers()->Get(layerIndex)->layer_as_InputLayer()->base()->layerBindingId();
446  }
447  else if ( layerType == Layer::Layer_OutputLayer )
448  {
449  return graphPtr->layers()->Get(layerIndex)->layer_as_OutputLayer()->base()->layerBindingId();
450  }
451  return 0;
452 }

◆ GetInputs()

TensorRawPtrVector GetInputs ( const GraphPtr graph,
unsigned int  layerIndex 
)
static

Definition at line 765 of file Deserializer.cpp.

766 {
767  CHECK_LAYERS(graphPtr, 0, layerIndex);
768  auto layer = GetBaseLayer(graphPtr, layerIndex);
769  const auto& numInputs = layer->inputSlots()->size();
770 
771  TensorRawPtrVector result(numInputs);
772 
773  for (unsigned int i=0; i<numInputs; ++i)
774  {
775  auto inputId = CHECKED_NON_NEGATIVE(static_cast<int32_t>
776  (layer->inputSlots()->Get(i)->connection()->sourceLayerIndex()));
777  result[i] = GetBaseLayer(graphPtr, inputId)->outputSlots()->Get(0)->tensorInfo();
778  }
779  return result;
780 }

References CHECK_LAYERS, and CHECKED_NON_NEGATIVE.

◆ GetLayerName()

std::string GetLayerName ( const GraphPtr graph,
unsigned int  index 
)
static

Definition at line 432 of file Deserializer.cpp.

433 {
434  auto layer = GetBaseLayer(graph, index);
435  assert(layer);
436  return layer->layerName()->str();
437 }

◆ GetLstmDescriptor()

armnn::LstmDescriptor GetLstmDescriptor ( LstmDescriptorPtr  lstmDescriptor)
static

Definition at line 3150 of file Deserializer.cpp.

3151 {
3152  armnn::LstmDescriptor desc;
3153 
3154  desc.m_ActivationFunc = lstmDescriptor->activationFunc();
3155  desc.m_ClippingThresCell = lstmDescriptor->clippingThresCell();
3156  desc.m_ClippingThresProj = lstmDescriptor->clippingThresProj();
3157  desc.m_CifgEnabled = lstmDescriptor->cifgEnabled();
3158  desc.m_PeepholeEnabled = lstmDescriptor->peepholeEnabled();
3159  desc.m_ProjectionEnabled = lstmDescriptor->projectionEnabled();
3160  desc.m_LayerNormEnabled = lstmDescriptor->layerNormEnabled();
3161 
3162  return desc;
3163 }

References LstmDescriptor::m_ActivationFunc, LstmDescriptor::m_CifgEnabled, LstmDescriptor::m_ClippingThresCell, LstmDescriptor::m_ClippingThresProj, LstmDescriptor::m_LayerNormEnabled, LstmDescriptor::m_PeepholeEnabled, and LstmDescriptor::m_ProjectionEnabled.

◆ GetLstmInputParams()

static armnn::LstmInputParams GetLstmInputParams ( LstmDescriptorPtr  lstmDescriptor,
LstmInputParamsPtr  lstmInputParams 
)
static

◆ 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 name.

Definition at line 898 of file Deserializer.cpp.

900 {
901  IgnoreUnused(layerIndex);
902  for (auto inputBinding : m_InputBindings)
903  {
904  if (inputBinding.first == name)
905  {
906  return inputBinding.second;
907  }
908  }
909  throw ParseException(fmt::format("No input binding found for layer:{0} / {1}",
910  name,
911  CHECK_LOCATION().AsString()));
912 }

References CHECK_LOCATION, and armnn::IgnoreUnused().

◆ 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 name.

Definition at line 914 of file Deserializer.cpp.

916 {
917  IgnoreUnused(layerIndex);
918  for (auto outputBinding : m_OutputBindings)
919  {
920  if (outputBinding.first == name)
921  {
922  return outputBinding.second;
923  }
924  }
925  throw ParseException(fmt::format("No output binding found for layer:{0} / {1}",
926  name,
927  CHECK_LOCATION().AsString()));
928 }

References CHECK_LOCATION, and armnn::IgnoreUnused().

◆ GetNormalizationDescriptor()

armnn::NormalizationDescriptor GetNormalizationDescriptor ( NormalizationDescriptorPtr  normalizationDescriptor,
unsigned int  layerIndex 
)
static

Definition at line 2821 of file Deserializer.cpp.

2824 {
2825  IgnoreUnused(layerIndex);
2827 
2828  switch (normalizationDescriptor->normChannelType())
2829  {
2830  case NormalizationAlgorithmChannel_Across:
2831  {
2833  break;
2834  }
2835  case NormalizationAlgorithmChannel_Within:
2836  {
2838  break;
2839  }
2840  default:
2841  {
2842  ARMNN_ASSERT_MSG(false, "Unsupported normalization channel type");
2843  }
2844  }
2845 
2846  switch (normalizationDescriptor->normMethodType())
2847  {
2848  case NormalizationAlgorithmMethod_LocalBrightness:
2849  {
2851  break;
2852  }
2853  case NormalizationAlgorithmMethod_LocalContrast:
2854  {
2856  break;
2857  }
2858  default:
2859  {
2860  ARMNN_ASSERT_MSG(false, "Unsupported normalization method type");
2861  }
2862  }
2863 
2864  switch (normalizationDescriptor->dataLayout())
2865  {
2866  case DataLayout_NCHW:
2867  {
2869  break;
2870  }
2871  case DataLayout_NHWC:
2872  {
2874  break;
2875  }
2876  default:
2877  {
2878  ARMNN_ASSERT_MSG(false, "Unsupported data layout");
2879  }
2880  }
2881 
2882  desc.m_Alpha = normalizationDescriptor->alpha();
2883  desc.m_Beta = normalizationDescriptor->beta();
2884  desc.m_K = normalizationDescriptor->k();
2885  desc.m_NormSize = normalizationDescriptor->normSize();
2886 
2887  return desc;
2888 }

References armnn::Across, ARMNN_ASSERT_MSG, armnn::IgnoreUnused(), armnn::LocalBrightness, armnn::LocalContrast, NormalizationDescriptor::m_Alpha, NormalizationDescriptor::m_Beta, NormalizationDescriptor::m_DataLayout, NormalizationDescriptor::m_K, NormalizationDescriptor::m_NormChannelType, NormalizationDescriptor::m_NormMethodType, NormalizationDescriptor::m_NormSize, armnn::NCHW, armnn::NHWC, and armnn::Within.

◆ GetOutputs()

TensorRawPtrVector GetOutputs ( const GraphPtr graph,
unsigned int  layerIndex 
)
static

Definition at line 782 of file Deserializer.cpp.

783 {
784  CHECK_LAYERS(graphPtr, 0, layerIndex);
785  auto layer = GetBaseLayer(graphPtr, layerIndex);
786  const auto& numOutputs = layer->outputSlots()->size();
787 
788  TensorRawPtrVector result(numOutputs);
789 
790  for (unsigned int i=0; i<numOutputs; ++i)
791  {
792  result[i] = layer->outputSlots()->Get(i)->tensorInfo();
793  }
794  return result;
795 }

References CHECK_LAYERS.

◆ GetPooling2dDescriptor()

armnn::Pooling2dDescriptor GetPooling2dDescriptor ( Pooling2dDescriptor  pooling2dDescriptor,
unsigned int  layerIndex 
)
static

Definition at line 2267 of file Deserializer.cpp.

2269 {
2270  IgnoreUnused(layerIndex);
2272 
2273  switch (pooling2dDesc->poolType())
2274  {
2275  case PoolingAlgorithm_Average:
2276  {
2278  break;
2279  }
2280  case PoolingAlgorithm_Max:
2281  {
2283  break;
2284  }
2285  case PoolingAlgorithm_L2:
2286  {
2288  break;
2289  }
2290  default:
2291  {
2292  ARMNN_ASSERT_MSG(false, "Unsupported pooling algorithm");
2293  }
2294  }
2295 
2296  switch (pooling2dDesc->outputShapeRounding())
2297  {
2298  case OutputShapeRounding_Floor:
2299  {
2301  break;
2302  }
2303  case OutputShapeRounding_Ceiling:
2304  {
2306  break;
2307  }
2308  default:
2309  {
2310  ARMNN_ASSERT_MSG(false, "Unsupported output shape rounding");
2311  }
2312  }
2313 
2314  switch (pooling2dDesc->paddingMethod())
2315  {
2316  case PaddingMethod_Exclude:
2317  {
2319  break;
2320  }
2321  case PaddingMethod_IgnoreValue:
2322  {
2324  break;
2325  }
2326  default:
2327  {
2328  ARMNN_ASSERT_MSG(false, "Unsupported padding method");
2329  }
2330  }
2331 
2332  switch (pooling2dDesc->dataLayout())
2333  {
2334  case DataLayout_NCHW:
2335  {
2337  break;
2338  }
2339  case DataLayout_NHWC:
2340  {
2342  break;
2343  }
2344  default:
2345  {
2346  ARMNN_ASSERT_MSG(false, "Unsupported data layout");
2347  }
2348  }
2349 
2350  desc.m_PadRight = pooling2dDesc->padRight();
2351  desc.m_PadLeft = pooling2dDesc->padLeft();
2352  desc.m_PadBottom = pooling2dDesc->padBottom();
2353  desc.m_PadTop = pooling2dDesc->padTop();
2354  desc.m_StrideX = pooling2dDesc->strideX();
2355  desc.m_StrideY = pooling2dDesc->strideY();
2356  desc.m_PoolWidth = pooling2dDesc->poolWidth();
2357  desc.m_PoolHeight = pooling2dDesc->poolHeight();
2358 
2359  return desc;
2360 }

References ARMNN_ASSERT_MSG, armnn::Average, armnn::Ceiling, armnn::Exclude, armnn::Floor, armnn::IgnoreUnused(), armnn::IgnoreValue, armnn::L2, Pooling2dDescriptor::m_DataLayout, Pooling2dDescriptor::m_OutputShapeRounding, Pooling2dDescriptor::m_PadBottom, Pooling2dDescriptor::m_PaddingMethod, Pooling2dDescriptor::m_PadLeft, Pooling2dDescriptor::m_PadRight, Pooling2dDescriptor::m_PadTop, Pooling2dDescriptor::m_PoolHeight, Pooling2dDescriptor::m_PoolType, Pooling2dDescriptor::m_PoolWidth, Pooling2dDescriptor::m_StrideX, Pooling2dDescriptor::m_StrideY, armnn::Max, armnn::NCHW, and armnn::NHWC.

◆ GetPooling3dDescriptor()

armnn::Pooling3dDescriptor GetPooling3dDescriptor ( Pooling3dDescriptor  pooling3dDescriptor,
unsigned int  layerIndex 
)
static

Definition at line 2362 of file Deserializer.cpp.

2364 {
2365  IgnoreUnused(layerIndex);
2367 
2368  switch (pooling3dDesc->poolType())
2369  {
2370  case PoolingAlgorithm_Average:
2371  {
2373  break;
2374  }
2375  case PoolingAlgorithm_Max:
2376  {
2378  break;
2379  }
2380  case PoolingAlgorithm_L2:
2381  {
2383  break;
2384  }
2385  default:
2386  {
2387  ARMNN_ASSERT_MSG(false, "Unsupported pooling algorithm");
2388  }
2389  }
2390 
2391  switch (pooling3dDesc->outputShapeRounding())
2392  {
2393  case OutputShapeRounding_Floor:
2394  {
2396  break;
2397  }
2398  case OutputShapeRounding_Ceiling:
2399  {
2401  break;
2402  }
2403  default:
2404  {
2405  ARMNN_ASSERT_MSG(false, "Unsupported output shape rounding");
2406  }
2407  }
2408 
2409  switch (pooling3dDesc->paddingMethod())
2410  {
2411  case PaddingMethod_Exclude:
2412  {
2414  break;
2415  }
2416  case PaddingMethod_IgnoreValue:
2417  {
2419  break;
2420  }
2421  default:
2422  {
2423  ARMNN_ASSERT_MSG(false, "Unsupported padding method");
2424  }
2425  }
2426 
2427  switch (pooling3dDesc->dataLayout())
2428  {
2429  case DataLayout_NCDHW:
2430  {
2432  break;
2433  }
2434  case DataLayout_NDHWC:
2435  {
2437  break;
2438  }
2439  default:
2440  {
2441  ARMNN_ASSERT_MSG(false, "Unsupported data layout");
2442  }
2443  }
2444 
2445  desc.m_PadRight = pooling3dDesc->padRight();
2446  desc.m_PadLeft = pooling3dDesc->padLeft();
2447  desc.m_PadBottom = pooling3dDesc->padBottom();
2448  desc.m_PadTop = pooling3dDesc->padTop();
2449  desc.m_PadFront = pooling3dDesc->padFront();
2450  desc.m_PadBack = pooling3dDesc->padBack();
2451  desc.m_StrideX = pooling3dDesc->strideX();
2452  desc.m_StrideY = pooling3dDesc->strideY();
2453  desc.m_StrideZ = pooling3dDesc->strideZ();
2454  desc.m_PoolWidth = pooling3dDesc->poolWidth();
2455  desc.m_PoolHeight = pooling3dDesc->poolHeight();
2456  desc.m_PoolDepth = pooling3dDesc->poolDepth();
2457 
2458  return desc;
2459 }

References ARMNN_ASSERT_MSG, armnn::Average, armnn::Ceiling, armnn::Exclude, armnn::Floor, armnn::IgnoreUnused(), armnn::IgnoreValue, armnn::L2, Pooling3dDescriptor::m_DataLayout, Pooling3dDescriptor::m_OutputShapeRounding, Pooling3dDescriptor::m_PadBack, Pooling3dDescriptor::m_PadBottom, Pooling3dDescriptor::m_PaddingMethod, Pooling3dDescriptor::m_PadFront, Pooling3dDescriptor::m_PadLeft, Pooling3dDescriptor::m_PadRight, Pooling3dDescriptor::m_PadTop, Pooling3dDescriptor::m_PoolDepth, Pooling3dDescriptor::m_PoolHeight, Pooling3dDescriptor::m_PoolType, Pooling3dDescriptor::m_PoolWidth, Pooling3dDescriptor::m_StrideX, Pooling3dDescriptor::m_StrideY, Pooling3dDescriptor::m_StrideZ, armnn::Max, armnn::NCDHW, and armnn::NDHWC.

◆ GetQLstmDescriptor()

armnn::QLstmDescriptor GetQLstmDescriptor ( QLstmDescriptorPtr  qLstmDescriptorPtr)
static

Definition at line 3281 of file Deserializer.cpp.

3282 {
3284 
3285  desc.m_CifgEnabled = qLstmDescriptor->cifgEnabled();
3286  desc.m_PeepholeEnabled = qLstmDescriptor->peepholeEnabled();
3287  desc.m_ProjectionEnabled = qLstmDescriptor->projectionEnabled();
3288  desc.m_LayerNormEnabled = qLstmDescriptor->layerNormEnabled();
3289 
3290  desc.m_CellClip = qLstmDescriptor->cellClip();
3291  desc.m_ProjectionClip = qLstmDescriptor->projectionClip();
3292 
3293  desc.m_InputIntermediateScale = qLstmDescriptor->inputIntermediateScale();
3294  desc.m_ForgetIntermediateScale = qLstmDescriptor->forgetIntermediateScale();
3295  desc.m_CellIntermediateScale = qLstmDescriptor->cellIntermediateScale();
3296  desc.m_OutputIntermediateScale = qLstmDescriptor->outputIntermediateScale();
3297 
3298  desc.m_HiddenStateScale = qLstmDescriptor->hiddenStateScale();
3299  desc.m_HiddenStateZeroPoint = qLstmDescriptor->hiddenStateZeroPoint();
3300 
3301  return desc;
3302 }

References QLstmDescriptor::m_CellClip, QLstmDescriptor::m_CellIntermediateScale, QLstmDescriptor::m_CifgEnabled, QLstmDescriptor::m_ForgetIntermediateScale, QLstmDescriptor::m_HiddenStateScale, QLstmDescriptor::m_HiddenStateZeroPoint, QLstmDescriptor::m_InputIntermediateScale, QLstmDescriptor::m_LayerNormEnabled, QLstmDescriptor::m_OutputIntermediateScale, QLstmDescriptor::m_PeepholeEnabled, QLstmDescriptor::m_ProjectionClip, and QLstmDescriptor::m_ProjectionEnabled.

◆ GetUnidirectionalSequenceLstmDescriptor()

armnn::UnidirectionalSequenceLstmDescriptor GetUnidirectionalSequenceLstmDescriptor ( UnidirectionalSequenceLstmDescriptorPtr  descriptor)
static

Definition at line 3713 of file Deserializer.cpp.

3715 {
3717 
3718  desc.m_ActivationFunc = descriptor->activationFunc();
3719  desc.m_ClippingThresCell = descriptor->clippingThresCell();
3720  desc.m_ClippingThresProj = descriptor->clippingThresProj();
3721  desc.m_CifgEnabled = descriptor->cifgEnabled();
3722  desc.m_PeepholeEnabled = descriptor->peepholeEnabled();
3723  desc.m_ProjectionEnabled = descriptor->projectionEnabled();
3724  desc.m_LayerNormEnabled = descriptor->layerNormEnabled();
3725  desc.m_TimeMajor = descriptor->timeMajor();
3726 
3727  return desc;
3728 }

References LstmDescriptor::m_ActivationFunc, LstmDescriptor::m_CifgEnabled, LstmDescriptor::m_ClippingThresCell, LstmDescriptor::m_ClippingThresProj, LstmDescriptor::m_LayerNormEnabled, LstmDescriptor::m_PeepholeEnabled, LstmDescriptor::m_ProjectionEnabled, and LstmDescriptor::m_TimeMajor.

◆ LoadGraphFromBinary()

GraphPtr LoadGraphFromBinary ( const uint8_t *  binaryContent,
size_t  len 
)
static

Definition at line 839 of file Deserializer.cpp.

840 {
841  if (binaryContent == nullptr)
842  {
843  throw InvalidArgumentException(fmt::format("Invalid (null) binary content {}",
844  CHECK_LOCATION().AsString()));
845  }
846  flatbuffers::Verifier verifier(binaryContent, len);
847  if (verifier.VerifyBuffer<SerializedGraph>() == false)
848  {
849  throw ParseException(fmt::format("Buffer doesn't conform to the expected Armnn "
850  "flatbuffers format. size:{0} {1}",
851  len,
852  CHECK_LOCATION().AsString()));
853  }
854  return GetSerializedGraph(binaryContent);
855 }

References CHECK_LOCATION.

◆ operator=()

DeserializerImpl& operator= ( const DeserializerImpl )
delete

◆ OutputShapeOfReshape()

armnn::TensorInfo OutputShapeOfReshape ( const armnn::TensorInfo inputTensorInfo,
const std::vector< uint32_t > &  targetDimsIn 
)
static

Definition at line 2522 of file Deserializer.cpp.

2524 {
2525  std::vector<unsigned int> outputDims(targetDimsIn.begin(), targetDimsIn.end());
2526  const auto stretchDim = std::find(targetDimsIn.begin(), targetDimsIn.end(), -1);
2527 
2528  if (stretchDim != targetDimsIn.end())
2529  {
2530  if (std::find(std::next(stretchDim), targetDimsIn.end(), -1) != targetDimsIn.end())
2531  {
2532  throw ParseException(fmt::format("At most one component of shape can be -1 {}",
2533  CHECK_LOCATION().AsString()));
2534  }
2535 
2536  auto targetNumElements =
2537  armnn::numeric_cast<unsigned int>(
2538  std::accumulate(targetDimsIn.begin(), targetDimsIn.end(), -1, std::multiplies<int32_t>()));
2539 
2540  auto stretchIndex = static_cast<size_t>(std::distance(targetDimsIn.begin(), stretchDim));
2541  outputDims[stretchIndex] = inputTensorInfo.GetNumElements() / targetNumElements;
2542  }
2543 
2544  TensorShape outputShape = TensorShape(static_cast<unsigned int>(outputDims.size()), outputDims.data());
2545 
2546  armnn::TensorInfo reshapeInfo = inputTensorInfo;
2547  reshapeInfo.SetShape(outputShape);
2548 
2549  return reshapeInfo;
2550 }

References CHECK_LOCATION, TensorInfo::GetNumElements(), and TensorInfo::SetShape().


The documentation for this class was generated from the following files:
armnn::QLstmDescriptor::m_CellClip
float m_CellClip
Clipping threshold value for the cell state.
Definition: Descriptors.hpp:1361
armnn::QLstmDescriptor::m_LayerNormEnabled
bool m_LayerNormEnabled
Enable/disable layer normalization.
Definition: Descriptors.hpp:1371
armnn::Pooling3dDescriptor::m_PadTop
uint32_t m_PadTop
Padding top value in the height dimension.
Definition: Descriptors.hpp:447
armnn::Pooling2dDescriptor::m_StrideY
uint32_t m_StrideY
Stride value when proceeding through input for the height dimension.
Definition: Descriptors.hpp:389
armnn::LstmDescriptor::m_TimeMajor
bool m_TimeMajor
Enable/disable time major.
Definition: Descriptors.hpp:1101
armnn::OutputShapeRounding::Ceiling
@ Ceiling
armnn::QLstmDescriptor::m_ProjectionClip
float m_ProjectionClip
Clipping threshold value for the projection.
Definition: Descriptors.hpp:1363
armnn::Pooling3dDescriptor::m_StrideX
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
Definition: Descriptors.hpp:461
armnn::NormalizationDescriptor
A NormalizationDescriptor for the NormalizationLayer.
Definition: Descriptors.hpp:737
armnn::QLstmDescriptor::m_ForgetIntermediateScale
float m_ForgetIntermediateScale
Forget intermediate quantization scale.
Definition: Descriptors.hpp:1375
CHECK_LOCATION
#define CHECK_LOCATION()
Definition: Exceptions.hpp:203
armnn::OutputShapeRounding::Floor
@ Floor
armnn::Pooling3dDescriptor::m_PadRight
uint32_t m_PadRight
Padding right value in the width dimension.
Definition: Descriptors.hpp:445
armnn::LstmDescriptor
An LstmDescriptor for the LstmLayer.
Definition: Descriptors.hpp:1049
armnn::NormalizationAlgorithmMethod::LocalContrast
@ LocalContrast
Jarret 2009: Local Contrast Normalization.
armnn::ParseException
Definition: Exceptions.hpp:92
armnnDeserializer::IDeserializer::DeserializerImpl::GetBaseLayer
static LayerBaseRawPtr GetBaseLayer(const GraphPtr &graphPtr, unsigned int layerIndex)
Definition: Deserializer.cpp:282
armnn::Pooling2dDescriptor::m_PoolHeight
uint32_t m_PoolHeight
Pooling height value.
Definition: Descriptors.hpp:385
armnn::Pooling3dDescriptor
A Pooling3dDescriptor for the Pooling3dLayer.
Definition: Descriptors.hpp:399
armnn::Pooling3dDescriptor::m_PoolWidth
uint32_t m_PoolWidth
Pooling width value.
Definition: Descriptors.hpp:455
armnn::IgnoreUnused
void IgnoreUnused(Ts &&...)
Definition: IgnoreUnused.hpp:14
armnn::Pooling3dDescriptor::m_OutputShapeRounding
OutputShapeRounding m_OutputShapeRounding
The rounding method for the output shape. (Floor, Ceiling).
Definition: Descriptors.hpp:467
armnn::LstmDescriptor::m_CifgEnabled
bool m_CifgEnabled
Enable/disable cifg (coupled input & forget gate).
Definition: Descriptors.hpp:1093
armnn::Pooling2dDescriptor::m_PoolType
PoolingAlgorithm m_PoolType
The pooling algorithm to use (Max. Average, L2).
Definition: Descriptors.hpp:373
armnn::LstmDescriptor::m_LayerNormEnabled
bool m_LayerNormEnabled
Enable/disable layer normalization.
Definition: Descriptors.hpp:1099
armnnDeserializer::GraphPtr
const armnnSerializer::SerializedGraph * GraphPtr
Definition: Deserializer.hpp:19
armnn::Pooling3dDescriptor::m_PadLeft
uint32_t m_PadLeft
Padding left value in the width dimension.
Definition: Descriptors.hpp:443
armnn::Pooling2dDescriptor::m_DataLayout
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
Definition: Descriptors.hpp:395
armnnDeserializer::IDeserializer::DeserializerImpl::LoadGraphFromBinary
static GraphPtr LoadGraphFromBinary(const uint8_t *binaryContent, size_t len)
Definition: Deserializer.cpp:839
armnn::PaddingMethod::IgnoreValue
@ IgnoreValue
The padding fields count, but are ignored.
armnn::Pooling2dDescriptor::m_StrideX
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
Definition: Descriptors.hpp:387
ARMNN_LOG
#define ARMNN_LOG(severity)
Definition: Logging.hpp:212
armnn::PoolingAlgorithm::L2
@ L2
armnn::NormalizationDescriptor::m_NormMethodType
NormalizationAlgorithmMethod m_NormMethodType
Normalization method algorithm to use (LocalBrightness, LocalContrast).
Definition: Descriptors.hpp:763
armnn::QLstmDescriptor::m_CellIntermediateScale
float m_CellIntermediateScale
Cell intermediate quantization scale.
Definition: Descriptors.hpp:1377
armnn::NormalizationAlgorithmChannel::Within
@ Within
armnn::QLstmDescriptor::m_OutputIntermediateScale
float m_OutputIntermediateScale
Output intermediate quantization scale.
Definition: Descriptors.hpp:1379
armnn::NormalizationDescriptor::m_DataLayout
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
Definition: Descriptors.hpp:773
armnn::TensorShape
Definition: Tensor.hpp:20
armnn::DataLayout::NCHW
@ NCHW
armnn::Pooling3dDescriptor::m_PadFront
uint32_t m_PadFront
Padding front value in the depth dimension.
Definition: Descriptors.hpp:451
armnnDeserializer::TensorRawPtrVector
std::vector< TensorRawPtr > TensorRawPtrVector
Definition: Deserializer.hpp:28
armnn::NormalizationAlgorithmChannel::Across
@ Across
armnn::NormalizationAlgorithmMethod::LocalBrightness
@ LocalBrightness
Krichevsky 2012: Local Brightness Normalization.
CHECK_LAYERS
#define CHECK_LAYERS(GRAPH, LAYERS_INDEX, LAYER_INDEX)
Definition: Deserializer.cpp:181
armnn::NormalizationDescriptor::m_NormSize
uint32_t m_NormSize
Depth radius value.
Definition: Descriptors.hpp:765
armnn::Pooling3dDescriptor::m_PadBack
uint32_t m_PadBack
Padding back value in the depth dimension.
Definition: Descriptors.hpp:453
armnn::DataLayout::NCDHW
@ NCDHW
armnn::Pooling2dDescriptor::m_PadBottom
uint32_t m_PadBottom
Padding bottom value in the height dimension.
Definition: Descriptors.hpp:381
armnn::Pooling3dDescriptor::m_StrideZ
uint32_t m_StrideZ
Stride value when proceeding through input for the depth dimension.
Definition: Descriptors.hpp:465
armnn::TensorInfo::GetNumElements
unsigned int GetNumElements() const
Definition: Tensor.hpp:196
armnn::LstmDescriptor::m_PeepholeEnabled
bool m_PeepholeEnabled
Enable/disable peephole.
Definition: Descriptors.hpp:1095
armnn::TensorInfo
Definition: Tensor.hpp:152
armnn::Pooling2dDescriptor::m_PoolWidth
uint32_t m_PoolWidth
Pooling width value.
Definition: Descriptors.hpp:383
armnn::Pooling3dDescriptor::m_PoolType
PoolingAlgorithm m_PoolType
The pooling algorithm to use (Max. Average, L2).
Definition: Descriptors.hpp:441
armnn::QLstmDescriptor
A QLstmDescriptor for the QLstmLayer.
Definition: Descriptors.hpp:1327
armnn::Pooling3dDescriptor::m_PoolDepth
uint32_t m_PoolDepth
Pooling depth value.
Definition: Descriptors.hpp:459
CHECKED_NON_NEGATIVE
#define CHECKED_NON_NEGATIVE(VALUE)
Definition: VerificationHelpers.hpp:35
armnn::Pooling3dDescriptor::m_PaddingMethod
PaddingMethod m_PaddingMethod
The padding method to be used. (Exclude, IgnoreValue).
Definition: Descriptors.hpp:469
armnn::Pooling2dDescriptor::m_PadLeft
uint32_t m_PadLeft
Padding left value in the width dimension.
Definition: Descriptors.hpp:375
armnn::QLstmDescriptor::m_HiddenStateScale
float m_HiddenStateScale
Hidden State quantization scale.
Definition: Descriptors.hpp:1383
armnn::QLstmDescriptor::m_HiddenStateZeroPoint
int32_t m_HiddenStateZeroPoint
Hidden State zero point.
Definition: Descriptors.hpp:1381
armnn::DataLayout::NHWC
@ NHWC
ARMNN_ASSERT_MSG
#define ARMNN_ASSERT_MSG(COND, MSG)
Definition: Assert.hpp:15
armnn::Pooling2dDescriptor::m_PadTop
uint32_t m_PadTop
Padding top value in the height dimension.
Definition: Descriptors.hpp:379
armnn::NormalizationDescriptor::m_K
float m_K
Kappa value used for the across channel normalization equation.
Definition: Descriptors.hpp:771
armnn::NormalizationDescriptor::m_Beta
float m_Beta
Beta value for the normalization equation.
Definition: Descriptors.hpp:769
armnn::LstmDescriptor::m_ClippingThresCell
float m_ClippingThresCell
Clipping threshold value for the cell state.
Definition: Descriptors.hpp:1089
armnn::Pooling2dDescriptor
A Pooling2dDescriptor for the Pooling2dLayer.
Definition: Descriptors.hpp:339
armnn::Pooling3dDescriptor::m_StrideY
uint32_t m_StrideY
Stride value when proceeding through input for the height dimension.
Definition: Descriptors.hpp:463
armnn::Pooling3dDescriptor::m_PadBottom
uint32_t m_PadBottom
Padding bottom value in the height dimension.
Definition: Descriptors.hpp:449
armnn::LstmDescriptor::m_ProjectionEnabled
bool m_ProjectionEnabled
Enable/disable the projection layer.
Definition: Descriptors.hpp:1097
armnn::PoolingAlgorithm::Max
@ Max
armnn::PoolingAlgorithm::Average
@ Average
armnn::QLstmDescriptor::m_InputIntermediateScale
float m_InputIntermediateScale
Input intermediate quantization scale.
Definition: Descriptors.hpp:1373
armnn::Pooling2dDescriptor::m_PadRight
uint32_t m_PadRight
Padding right value in the width dimension.
Definition: Descriptors.hpp:377
armnn::QLstmDescriptor::m_CifgEnabled
bool m_CifgEnabled
Enable/disable CIFG (coupled input & forget gate).
Definition: Descriptors.hpp:1365
armnn::NormalizationDescriptor::m_NormChannelType
NormalizationAlgorithmChannel m_NormChannelType
Normalization channel algorithm to use (Across, Within).
Definition: Descriptors.hpp:761
armnn::LstmDescriptor::m_ActivationFunc
uint32_t m_ActivationFunc
The activation function to use.
Definition: Descriptors.hpp:1087
armnn::LstmDescriptor::m_ClippingThresProj
float m_ClippingThresProj
Clipping threshold value for the projection.
Definition: Descriptors.hpp:1091
armnn::TensorInfo::SetShape
void SetShape(const TensorShape &newShape)
Definition: Tensor.hpp:193
armnn::QLstmDescriptor::m_PeepholeEnabled
bool m_PeepholeEnabled
Enable/disable peephole.
Definition: Descriptors.hpp:1367
armnn::Pooling3dDescriptor::m_PoolHeight
uint32_t m_PoolHeight
Pooling height value.
Definition: Descriptors.hpp:457
armnn::Pooling2dDescriptor::m_PaddingMethod
PaddingMethod m_PaddingMethod
The padding method to be used. (Exclude, IgnoreValue).
Definition: Descriptors.hpp:393
armnn::PaddingMethod::Exclude
@ Exclude
The padding fields don't count and are ignored.
armnn::DataLayout::NDHWC
@ NDHWC
armnn::InvalidArgumentException
Definition: Exceptions.hpp:80
armnn::Pooling3dDescriptor::m_DataLayout
DataLayout m_DataLayout
The data layout to be used (NCDHW, NDHWC).
Definition: Descriptors.hpp:471
armnn::QLstmDescriptor::m_ProjectionEnabled
bool m_ProjectionEnabled
Enable/disable the projection layer.
Definition: Descriptors.hpp:1369
armnn::NormalizationDescriptor::m_Alpha
float m_Alpha
Alpha value for the normalization equation.
Definition: Descriptors.hpp:767
armnn::Pooling2dDescriptor::m_OutputShapeRounding
OutputShapeRounding m_OutputShapeRounding
The rounding method for the output shape. (Floor, Ceiling).
Definition: Descriptors.hpp:391