24.08
|
Go to the documentation of this file.
14 namespace optimizations
31 if (CanMoveTransposeToInputs(base))
33 auto transpose = PolymorphicDowncast<TransposeLayer*>(&connection.
GetOwningLayer());
40 const std::string name = std::string(
"moved_up-") + transpose->GetName();
50 transpose->GetOutputSlot().MoveAllConnections(base.
GetOutputSlot());
60 static bool CanMoveTransposeToInputs(
const Layer& base)
73 auto descriptor = PolymorphicDowncast<const ElementwiseBinaryDescriptor*>(&base.
GetParameters());
~MoveTransposeUpImpl()=default
void SetTensorInfo(const TensorInfo &tensorInfo)
Sets the TensorInfo used by this output handler.
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
Get the const output slot handle by slot index.
armnn::TensorShape TransposeTensorShape(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.
void Run(Graph &graph, InputSlot &connection) const
Run for every connection between a base Layer (any) and a child TransposeLayer.
MoveTransposeUpImpl()=default
This layer represents a transpose operation.
Layer & GetOwningLayer() const
unsigned int GetNumConnections() const override
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.
Copyright (c) 2021 ARM Limited and Contributors.
LayerT * InsertNewLayer(InputSlot &insertBefore, Args &&... args)
Inserts a new layer between the output slot currently connected to insertBefore and insertBefore itse...