14 namespace optimizations
17 static const std::set<armnn::LayerType> broadcastOps {
32 if (std::find(broadcastOps.begin(), broadcastOps.end(), layer.
GetType()) != broadcastOps.end())
45 unsigned int reshapeSlot = 1;
52 reshapeInfo = inputInfo0;
53 inputInfo = inputInfo1;
58 std::vector<unsigned> reshapedDim;
61 reshapedDim.push_back(reshapeInfo.
GetShape()[i]);
64 std::vector<unsigned int> reshapedDimensions(numDimensions, 1);
65 std::copy_backward (reshapedDim.begin(), reshapedDim.end(), reshapedDimensions.end());
68 const std::string layerName =
"Reshape_for:" + layer.
GetNameStr() +
"-" + std::to_string(reshapeSlot);
const TensorShape & GetShape() const
A ReshapeDescriptor for the ReshapeLayer.
void Run(Graph &graph, Layer &layer) const
Run for every ElementwiseBaseLayer. Add Broadcast reshape layer if the inputs shape are different...
~AddBroadcastReshapeLayerImpl()=default
This layer represents a reshape operation.
Copyright (c) 2020 ARM Limited.
void SetShape(const TensorShape &newShape)
const InputSlot & GetInputSlot(unsigned int index) const override
Get a const input slot handle by slot index.
const std::string & GetNameStr() const
AddBroadcastReshapeLayerImpl()=default
void SetTensorInfo(const TensorInfo &tensorInfo) override
LayerType GetType() const
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
Get the const output slot handle by slot index.
bool IsTensorInfoSet() const override
LayerT * InsertNewLayer(InputSlot &insertBefore, Args &&... args)
Inserts a new layer between the output slot currently connected to insertBefore and insertBefore itse...
const TensorInfo & GetTensorInfo() const override
unsigned int GetNumDimensions() const