14 namespace optimizations
33 ReplaceConstPermuteLayer<DataType::Float16>(graph,
34 PolymorphicDowncast<ConstantLayer*>(&base),
35 PolymorphicDowncast<PermuteLayer*>(&child));
38 ReplaceConstPermuteLayer<DataType::Float32>(graph,
39 PolymorphicDowncast<ConstantLayer*>(&base),
40 PolymorphicDowncast<PermuteLayer*>(&child));
43 ReplaceConstPermuteLayer<DataType::QAsymmU8>(graph,
44 PolymorphicDowncast<ConstantLayer*>(&base),
45 PolymorphicDowncast<PermuteLayer*>(&child));
48 ReplaceConstPermuteLayer<DataType::Signed32>(graph,
49 PolymorphicDowncast<ConstantLayer*>(&base),
50 PolymorphicDowncast<PermuteLayer*>(&child));
53 ReplaceConstPermuteLayer<DataType::QSymmS16>(graph,
54 PolymorphicDowncast<ConstantLayer*>(&base),
55 PolymorphicDowncast<PermuteLayer*>(&child));
58 ReplaceConstPermuteLayer<DataType::QSymmS8>(graph,
59 PolymorphicDowncast<ConstantLayer*>(&base),
60 PolymorphicDowncast<PermuteLayer*>(&child));
63 ReplaceConstPermuteLayer<DataType::QAsymmS8>(graph,
64 PolymorphicDowncast<ConstantLayer*>(&base),
65 PolymorphicDowncast<PermuteLayer*>(&child));
68 ReplaceConstPermuteLayer<DataType::BFloat16>(graph,
69 PolymorphicDowncast<ConstantLayer*>(&base),
70 PolymorphicDowncast<PermuteLayer*>(&child));
73 ReplaceConstPermuteLayer<DataType::Signed64>(graph,
74 PolymorphicDowncast<ConstantLayer*>(&base),
75 PolymorphicDowncast<PermuteLayer*>(&child));
78 ReplaceConstPermuteLayer<DataType::Boolean>(graph,
79 PolymorphicDowncast<ConstantLayer*>(&base),
80 PolymorphicDowncast<PermuteLayer*>(&child));
91 static void ReplaceConstPermuteLayer(
Graph& graph,
#define ARMNN_ASSERT(COND)
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
A layer that the constant data can be bound to.
std::shared_ptr< ConstTensorHandle > m_LayerOutput
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
Get the const output slot handle by slot index.
LayerType GetType() const override
Returns the armnn::LayerType of this layer.
DataType GetDataType() const
void MoveAllConnections(OutputSlot &destination)
Moves all connections to another OutputSlot.
Layer & GetOwningLayer() const
void SetTensorInfo(const TensorInfo &tensorInfo) override
const TensorInfo & GetTensorInfo() const override
This layer represents a permutation operation.
const PermutationVector & GetPermutation() const
unsigned int GetNumElements() const
const TensorShape & GetShape() const
void SetConstant(const bool IsConstant=true)
Marks the data corresponding to this tensor info as constant.
DataType GetDataType() const
~ConvertConstPermuteLayersToConstLayers()=default
void Run(Graph &graph, InputSlot &connection) const
ConvertConstPermuteLayersToConstLayers()=default
Copyright (c) 2021 ARM Limited and Contributors.
typename ResolveTypeImpl< DT >::Type ResolveType
void IgnoreUnused(Ts &&...)
constexpr unsigned int GetDataTypeSize(DataType dataType)
void Permute(const armnn::TensorShape &dstShape, const armnn::PermutationVector &mappings, const void *src, void *dst, size_t dataTypeSize)