13 namespace optimizations
30 if (CanMovePermuteToInputs(base))
32 auto permute = boost::polymorphic_downcast<PermuteLayer*>(&connection.
GetOwningLayer());
39 const std::string name = std::string(
"moved_up-") + permute->GetName();
49 const TensorInfo& childOutInfo = permute->GetOutputHandler().GetTensorInfo();
53 permute->GetOutputSlot().MoveAllConnections(base.
GetOutputSlot());
63 static bool CanMovePermuteToInputs(
const Layer& base)
std::vector< InputSlot >::iterator EndInputSlots()
Layer & GetOwningLayer() const
Copyright (c) 2020 ARM Limited.
This layer represents a permutation operation.
std::vector< InputSlot >::iterator BeginInputSlots()
unsigned int GetNumConnections() const override
const InputSlot & GetInputSlot(unsigned int index) const override
Get a const input slot handle by slot index.
MovePermuteUpImpl()=default
void SetTensorInfo(const TensorInfo &tensorInfo)
Sets the TensorInfo used by this output handler.
const OutputHandler & GetOutputHandler(unsigned int i=0) const
LayerType GetType() const
void Run(Graph &graph, InputSlot &connection) const
Run for every connection between a base Layer (any) and a child PermuteLayer.
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
Get the const output slot handle by slot index.
~MovePermuteUpImpl()=default
LayerT * InsertNewLayer(InputSlot &insertBefore, Args &&... args)
Inserts a new layer between the output slot currently connected to insertBefore and insertBefore itse...
armnn::TensorShape Permuted(const armnn::TensorShape &srcShape, const armnn::PermutationVector &mappings)