24.02
|
Go to the documentation of this file.
15 namespace optimizations
29 if (std::find(broadcastOps.begin(), broadcastOps.end(), layer.
GetType()) != broadcastOps.end())
42 unsigned int reshapeSlot = 1;
49 reshapeInfo = inputInfo0;
50 inputInfo = inputInfo1;
55 std::vector<unsigned> reshapedDim;
58 reshapedDim.push_back(reshapeInfo.
GetShape()[i]);
61 std::vector<unsigned int> reshapedDimensions(numDimensions, 1);
62 std::copy_backward(reshapedDim.begin(), reshapedDim.end(), reshapedDimensions.end());
74 constantLayer.
m_LayerOutput = std::make_unique<ScopedTensorHandle>(
80 const std::string layerName =
"Reshape_for:" + layer.
GetNameStr() +
"-" + std::to_string(reshapeSlot);
const TensorInfo & GetTensorInfo() const override
void SetTensorInfo(const TensorInfo &tensorInfo) override
unsigned int GetNumDimensions() const
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
Get the const output slot handle by slot index.
const InputSlot & GetInputSlot(unsigned int index) const override
Get a const input slot handle by slot index.
bool IsTensorInfoSet() const override
Layer & GetOwningLayer() const
This layer represents a reshape operation.
unsigned int GetNumConnections() const override
A ReshapeDescriptor for the ReshapeLayer.
AddBroadcastReshapeLayerImpl()=default
~AddBroadcastReshapeLayerImpl()=default
const std::string & GetNameStr() const
LayerType GetType() const override
Returns the armnn::LayerType of this layer.
const TensorShape & GetShape() const
std::shared_ptr< ConstTensorHandle > m_LayerOutput
A layer that the constant data can be bound to.
void SetShape(const TensorShape &newShape)
Copyright (c) 2021 ARM Limited and Contributors.
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
void Run(Graph &graph, Layer &layer) const
Run for every ElementwiseBaseLayer. Add Broadcast reshape layer if the inputs shape are different.
LayerT * InsertNewLayer(InputSlot &insertBefore, Args &&... args)
Inserts a new layer between the output slot currently connected to insertBefore and insertBefore itse...