24.08
|
Go to the documentation of this file.
14 auto* op =
new TosaSerializationOperator(Op_UNKNOWN, Attribute_NONE,
nullptr, {}, {});
15 return new TosaSerializationBasicBlock(
"",
"", {op}, {}, {}, {});
20 const std::vector<const TensorInfo*>& inputs,
21 const std::vector<const TensorInfo*>& outputs,
28 auto activationDesc = PolymorphicDowncast<const ActivationDescriptor*>(&descriptor);
29 switch (activationDesc->m_Function)
58 auto binaryDesc = PolymorphicDowncast<const ElementwiseBinaryDescriptor*>(&descriptor);
63 auto unaryDesc = PolymorphicDowncast<const ElementwiseUnaryDescriptor*>(&descriptor);
64 switch(unaryDesc->m_Operation)
86 auto batchMatMulDesc = PolymorphicDowncast<const BatchMatMulDescriptor*>(&descriptor);
91 auto concatDesc = PolymorphicDowncast<const OriginsDescriptor*>(&descriptor);
96 bool isDepthwiseConv2dWeights =
false;
105 isDepthwiseConv2dWeights =
true;
112 auto conv2dDesc = PolymorphicDowncast<const Convolution2dDescriptor*>(&descriptor);
117 auto conv2dDesc = PolymorphicDowncast<const DepthwiseConvolution2dDescriptor*>(&descriptor);
122 auto fullyConnectedDesc = PolymorphicDowncast<const FullyConnectedDescriptor*>(&descriptor);
127 auto padDesc = PolymorphicDowncast<const PadDescriptor*>(&descriptor);
132 auto poolDesc = PolymorphicDowncast<const Pooling2dDescriptor*>(&descriptor);
134 bool avgPoolIgnoreValue =
142 else if (avgPoolIgnoreValue)
153 auto meanDesc = PolymorphicDowncast<const MeanDescriptor*>(&descriptor);
157 reduceDesc.
m_vAxis = meanDesc->m_Axis;
168 auto reduceDesc = PolymorphicDowncast<const ReduceDescriptor*>(&descriptor);
173 auto reshapeDesc = PolymorphicDowncast<const ReshapeDescriptor*>(&descriptor);
178 auto resizeDesc = PolymorphicDowncast<const ResizeDescriptor*>(&descriptor);
183 auto sliceDesc = PolymorphicDowncast<const SliceDescriptor*>(&descriptor);
188 auto softmaxDesc = PolymorphicDowncast<const SoftmaxDescriptor*>(&descriptor);
193 auto splitDesc = PolymorphicDowncast<const SplitterDescriptor*>(&descriptor);
198 auto transposeConv2dDesc = PolymorphicDowncast<const TransposeConvolution2dDescriptor*>(&descriptor);
203 auto transposeDesc = PolymorphicDowncast<const TransposeDescriptor*>(&descriptor);
215 std::vector<const TensorInfo*> inputs;
218 inputs.push_back(&inputSlot.GetTensorInfo());
221 std::vector<const TensorInfo*> outputs;
224 outputs.push_back(&outputSlot.GetTensorInfo());
TosaSerializationBasicBlock * ConvertGeluToTosaOperator(const Layer *layer, const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs, const ActivationDescriptor *desc)
TosaSerializationBasicBlock * CreateEmptyTosaSerializationBasicBlock()
TosaSerializationBasicBlock * ConvertReshapeToTosaOperator(const Layer *layer, const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs, const ReshapeDescriptor *reshapeDescriptor)
TosaSerializationBasicBlock * ConvertRsqrtOperator(const Layer *layer, const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs, const ElementwiseUnaryDescriptor *unaryDescriptor)
TosaSerializationBasicBlock * ConvertElementwiseBinaryToTosaOperator(const Layer *layer, const LayerType type, const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs, const ElementwiseBinaryDescriptor *descriptor)
TosaSerializationBasicBlock * ConvertAvgPool2DIgnoreValueToTosaOperator(const Layer *layer, const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs, const Pooling2dDescriptor *poolDescriptor)
TosaSerializationBasicBlock * ConvertConv2dToTosaOperator(const Layer *layer, const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs, const Convolution2dDescriptor *conv2dDescriptor)
TosaSerializationBasicBlock * ConvertPooling2DToTosaOperator(const Layer *layer, const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs, const Pooling2dDescriptor *poolDescriptor)
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
Get the const output slot handle by slot index.
TosaSerializationBasicBlock * ConvertConcatToTosaOperator(const Layer *layer, const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs, const OriginsDescriptor *concatDescriptor)
@ BoundedReLu
min(a, max(b, input)) ReLu1 & ReLu6.
const std::vector< InputSlot > & GetInputSlots() const
ReduceOperation m_ReduceOperation
Specifies the reduction operation to execute.
TosaSerializationBasicBlock * ConvertSplitToTosaOperator(const Layer *layer, const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs, const SplitterDescriptor *splitDescriptor)
TosaSerializationBasicBlock * ConvertPadToTosaOperator(const Layer *layer, const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs, const PadDescriptor *padDescriptor)
TosaSerializationBasicBlock * GetTosaMappingFromLayer(const Layer *layer)
TosaSerializationBasicBlock * ConvertSliceToTosaOperator(const Layer *layer, const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs, const SliceDescriptor *sliceDescriptor)
TosaSerializationBasicBlock * ConvertReluToTosaOperator(const Layer *layer, const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs, const ActivationDescriptor *desc)
@ IgnoreValue
The padding fields count, but are ignored.
TosaSerializationBasicBlock * ConvertLeakyReluToTosaOperator(const Layer *layer, const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs, const ActivationDescriptor *activationDescriptor)
const std::vector< OutputSlot > & GetOutputSlots() const
Base class for all descriptors.
TosaSerializationBasicBlock * GetTosaMapping(const Layer *layer, const LayerType type, const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs, const BaseDescriptor &descriptor)
TosaSerializationBasicBlock * ConvertTransposeConv2dToTosaOperator(const Layer *layer, const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs, const TransposeConvolution2dDescriptor *descriptor)
bool m_KeepDims
if true then output shape has no change.
virtual const BaseDescriptor & GetParameters() const override
If the layer has a descriptor return it.
TosaSerializationBasicBlock * ConvertQuantizeToTosaOperator(const Layer *layer, const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs)
TosaSerializationBasicBlock * ConvertReduceToTosaOperator(const Layer *layer, const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs, const ReduceDescriptor *reduceDescriptor)
LayerType GetType() const override
Returns the armnn::LayerType of this layer.
TosaSerializationBasicBlock * ConvertConstantToTosaOperator(const Layer *layer, const std::vector< const TensorInfo * > &outputs, bool isDepthwiseConv2dWeights=false)
std::vector< uint32_t > m_vAxis
The indices of the dimensions to reduce.
TosaSerializationBasicBlock * ConvertDepthwiseConv2dToTosaOperator(const Layer *layer, const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs, const DepthwiseConvolution2dDescriptor *conv2dDescriptor)
TosaSerializationBasicBlock * ConvertFullyConnectedToTosaOperator(const Layer *layer, const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs, const FullyConnectedDescriptor *fcDescriptor)
Copyright (c) 2021 ARM Limited and Contributors.
TosaSerializationBasicBlock * ConvertResizeToTosaOperator(const Layer *layer, const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs, const ResizeDescriptor *resizeDescriptor)
TosaSerializationBasicBlock * ConvertSoftmaxToTosaOperator(const Layer *layer, const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs, const SoftmaxDescriptor *softmaxDescriptor)
TosaSerializationBasicBlock * ConvertTransposeToTosaOperator(const Layer *layer, const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs, const TransposeDescriptor *transposeDescriptor)
TosaSerializationBasicBlock * ConvertLogOperator(const Layer *layer, const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs, const ElementwiseUnaryDescriptor *unaryDescriptor)
A ReduceDescriptor for the REDUCE operators.
LayerType
When adding a new layer, adapt also the LastLayer enum value in the enum class LayerType below.
const InputSlot * GetConnection(unsigned int index) const override
TosaSerializationBasicBlock * ConvertExpOperator(const Layer *layer, const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs, const ElementwiseUnaryDescriptor *unaryDescriptor)
TosaSerializationBasicBlock * ConvertBatchMatMulToTosaOperator(const Layer *layer, const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs, const BatchMatMulDescriptor *descriptor)