24.08
|
Go to the documentation of this file.
14 namespace optimizations
31 if (CanMovePermuteToInputs(base))
33 auto permute = PolymorphicDowncast<PermuteLayer*>(&connection.
GetOwningLayer());
40 const std::string name = std::string(
"moved_up-") + permute->GetName();
50 permute->GetOutputSlot().MoveAllConnections(base.
GetOutputSlot());
60 static bool CanMovePermuteToInputs(
const Layer& base)
73 auto descriptor = PolymorphicDowncast<const ElementwiseBinaryDescriptor*>(&base.
GetParameters());
void SetTensorInfo(const TensorInfo &tensorInfo)
Sets the TensorInfo used by this output handler.
~MovePermuteUpImpl()=default
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
Get the const output slot handle by slot index.
armnn::TensorShape Permuted(const armnn::TensorShape &srcShape, const armnn::PermutationVector &mappings)
const InputSlot & GetInputSlot(unsigned int index) const override
Get a const input slot handle by slot index.
Layer & GetOwningLayer() const
unsigned int GetNumConnections() const override
void Run(Graph &graph, InputSlot &connection) const
Run for every connection between a base Layer (any) and a child PermuteLayer.
std::vector< InputSlot >::iterator EndInputSlots()
const OutputHandler & GetOutputHandler(unsigned int i=0) const
std::vector< InputSlot >::iterator BeginInputSlots()
virtual const BaseDescriptor & GetParameters() const override
If the layer has a descriptor return it.
LayerType GetType() const override
Returns the armnn::LayerType of this layer.
MovePermuteUpImpl()=default
Copyright (c) 2021 ARM Limited and Contributors.
This layer represents a permutation operation.
LayerT * InsertNewLayer(InputSlot &insertBefore, Args &&... args)
Inserts a new layer between the output slot currently connected to insertBefore and insertBefore itse...