ArmNN
 24.08
ConvertConstPermuteLayersToConstLayers Class Reference

#include <ConvertConstPermuteLayersToConstLayers.hpp>

Public Member Functions

void Run (Graph &graph, InputSlot &connection) const
 

Protected Member Functions

 ConvertConstPermuteLayersToConstLayers ()=default
 
 ~ConvertConstPermuteLayersToConstLayers ()=default
 

Detailed Description

Definition at line 17 of file ConvertConstPermuteLayersToConstLayers.hpp.

Constructor & Destructor Documentation

◆ ConvertConstPermuteLayersToConstLayers()

◆ ~ConvertConstPermuteLayersToConstLayers()

Member Function Documentation

◆ Run()

void Run ( Graph graph,
InputSlot connection 
) const
inline

Definition at line 20 of file ConvertConstPermuteLayersToConstLayers.hpp.

21  {
22  Layer& base = connection.GetConnectedOutputSlot()->GetOwningLayer();
23  Layer& child = connection.GetOwningLayer();
24 
25  ARMNN_ASSERT(base.GetType() == LayerType::Constant);
26  ARMNN_ASSERT(child.GetType() == LayerType::Permute);
27 
28  if (base.GetDataType() == child.GetDataType())
29  {
30  switch (base.GetDataType())
31  {
32  case DataType::Float16:
33  ReplaceConstPermuteLayer<DataType::Float16>(graph,
34  PolymorphicDowncast<ConstantLayer*>(&base),
35  PolymorphicDowncast<PermuteLayer*>(&child));
36  break;
37  case DataType::Float32:
38  ReplaceConstPermuteLayer<DataType::Float32>(graph,
39  PolymorphicDowncast<ConstantLayer*>(&base),
40  PolymorphicDowncast<PermuteLayer*>(&child));
41  break;
42  case DataType::QAsymmU8:
43  ReplaceConstPermuteLayer<DataType::QAsymmU8>(graph,
44  PolymorphicDowncast<ConstantLayer*>(&base),
45  PolymorphicDowncast<PermuteLayer*>(&child));
46  break;
47  case DataType::Signed32:
48  ReplaceConstPermuteLayer<DataType::Signed32>(graph,
49  PolymorphicDowncast<ConstantLayer*>(&base),
50  PolymorphicDowncast<PermuteLayer*>(&child));
51  break;
52  case DataType::QSymmS16:
53  ReplaceConstPermuteLayer<DataType::QSymmS16>(graph,
54  PolymorphicDowncast<ConstantLayer*>(&base),
55  PolymorphicDowncast<PermuteLayer*>(&child));
56  break;
57  case DataType::QSymmS8:
58  ReplaceConstPermuteLayer<DataType::QSymmS8>(graph,
59  PolymorphicDowncast<ConstantLayer*>(&base),
60  PolymorphicDowncast<PermuteLayer*>(&child));
61  break;
62  case DataType::QAsymmS8:
63  ReplaceConstPermuteLayer<DataType::QAsymmS8>(graph,
64  PolymorphicDowncast<ConstantLayer*>(&base),
65  PolymorphicDowncast<PermuteLayer*>(&child));
66  break;
67  case DataType::BFloat16:
68  ReplaceConstPermuteLayer<DataType::BFloat16>(graph,
69  PolymorphicDowncast<ConstantLayer*>(&base),
70  PolymorphicDowncast<PermuteLayer*>(&child));
71  break;
72  case DataType::Signed64:
73  ReplaceConstPermuteLayer<DataType::Signed64>(graph,
74  PolymorphicDowncast<ConstantLayer*>(&base),
75  PolymorphicDowncast<PermuteLayer*>(&child));
76  break;
77  case DataType::Boolean:
78  ReplaceConstPermuteLayer<DataType::Boolean>(graph,
79  PolymorphicDowncast<ConstantLayer*>(&base),
80  PolymorphicDowncast<PermuteLayer*>(&child));
81  break;
82  }
83  }
84  }

References ARMNN_ASSERT, armnn::BFloat16, armnn::Boolean, armnn::Constant, armnn::Float16, armnn::Float32, InputSlot::GetConnectedOutputSlot(), Layer::GetDataType(), InputSlot::GetOwningLayer(), OutputSlot::GetOwningLayer(), Layer::GetType(), armnn::Permute, armnn::QAsymmS8, armnn::QAsymmU8, armnn::QSymmS16, armnn::QSymmS8, armnn::Signed32, and armnn::Signed64.


The documentation for this class was generated from the following file:
ARMNN_ASSERT
#define ARMNN_ASSERT(COND)
Definition: Assert.hpp:14
armnn::DataType::Boolean
@ Boolean
armnn::LayerType::Permute
@ Permute
armnn::DataType::Float32
@ Float32
armnn::DataType::QAsymmU8
@ QAsymmU8
armnn::DataType::QSymmS8
@ QSymmS8
armnn::DataType::QSymmS16
@ QSymmS16
armnn::DataType::BFloat16
@ BFloat16
armnn::DataType::Float16
@ Float16
armnn::DataType::Signed32
@ Signed32
armnn::DataType::QAsymmS8
@ QAsymmS8
armnn::DataType::Signed64
@ Signed64
armnn::LayerType::Constant
@ Constant