11 #include <initializer_list> 36 : m_Function(activation)
85 : m_Operation(operation)
105 : m_Operation(operation)
125 : m_DimMappings(dimMappings)
179 Status SetViewOriginCoord(uint32_t view, uint32_t coord, uint32_t value);
181 uint32_t GetNumViews()
const;
183 uint32_t GetNumDimensions()
const;
185 const uint32_t* GetViewOrigin(uint32_t idx)
const;
188 void ReorderOrigins(
unsigned int* newOrdering,
unsigned int numNewOrdering);
192 void SetConcatAxis(
unsigned int concatAxis);
194 unsigned int GetConcatAxis()
const;
197 unsigned int m_ConcatAxis;
199 uint32_t m_NumDimensions;
200 uint32_t** m_ViewOrigins;
222 Status SetViewOriginCoord(uint32_t view, uint32_t coord, uint32_t value);
226 Status SetViewSize(uint32_t view, uint32_t coord, uint32_t value);
229 uint32_t GetNumViews()
const;
231 uint32_t GetNumDimensions()
const;
233 const uint32_t* GetViewOrigin(uint32_t idx)
const;
235 const uint32_t* GetViewSizes(uint32_t idx)
const;
243 uint32_t** m_ViewSizes;
249 template <
typename TensorShapeIt>
252 unsigned int concatenationDimension)
254 auto numInputs = std::distance(first, last);
261 const auto& firstInputShape = *first;
263 const unsigned int numDimensions = firstInputShape.GetNumDimensions();
264 for (
auto it = first + 1; it != last; ++it)
266 if (it->GetNumDimensions() != numDimensions)
272 if (concatenationDimension >= numDimensions)
277 for (
auto it = first; it != last; ++it)
279 for (
unsigned int d = 0; d < numDimensions; ++d)
281 const bool dimSizeOk = (d == concatenationDimension) || (firstInputShape[d] == (*it)[d]);
285 " except the concatenation dimension");
290 OriginsDescriptor viewsDescriptor(static_cast<uint32_t>(numInputs), numDimensions);
293 uint32_t viewIndex = 0u;
294 uint32_t coordAlongConcatDim = 0u;
295 for (
auto it = first; it != last; ++it)
297 const auto& inputShape = *it;
299 for (
unsigned int i = 0; i < concatenationDimension; ++i)
304 viewsDescriptor.
SetViewOriginCoord(viewIndex, concatenationDimension, coordAlongConcatDim);
305 unsigned int dimSize = inputShape[concatenationDimension];
306 coordAlongConcatDim += dimSize;
309 for (
unsigned int i = concatenationDimension + 1; i < numDimensions; ++i)
317 return viewsDescriptor;
384 : m_BiasEnabled(false)
385 , m_TransposeWeightMatrix(false)
386 , m_ConstantWeights(true)
398 uint32_t GetNumViews()
const;
401 uint32_t GetNumInputs()
const;
423 , m_BiasEnabled(false)
479 , m_BiasEnabled(false)
502 uint32_t GetNumInputs()
const;
546 , m_BiasEnabled(false)
590 , m_MaxClassesPerDetection(1)
591 , m_DetectionsPerClass(1)
592 , m_NmsScoreThreshold(0)
593 , m_NmsIouThreshold(0)
595 , m_UseRegularNms(false)
731 return m_Gamma == rhs.
m_Gamma &&
733 m_Eps == rhs.
m_Eps &&
751 : m_BlockShape({1, 1})
752 , m_Crops({{0, 0}, {0, 0}})
757 std::vector<std::pair<unsigned int, unsigned int>> crops)
758 : m_BlockShape(blockShape)
773 std::vector<std::pair<unsigned int, unsigned int>>
m_Crops;
788 return m_Min == rhs.
m_Min && m_Max == rhs.
m_Max;
829 return m_Axis == rhs.
m_Axis;
842 ResizeBilinearDescriptor()
846 , m_AlignCorners(
false)
847 , m_HalfPixelCenters(
false)
851 bool operator ==(
const ResizeBilinearDescriptor& rhs)
const 853 return m_TargetWidth == rhs.m_TargetWidth &&
854 m_TargetHeight == rhs.m_TargetHeight &&
855 m_DataLayout == rhs.m_DataLayout &&
856 m_AlignCorners == rhs.m_AlignCorners &&
857 m_HalfPixelCenters == rhs.m_HalfPixelCenters;
862 uint32_t m_TargetWidth;
864 uint32_t m_TargetHeight;
870 bool m_HalfPixelCenters;
881 , m_AlignCorners(false)
882 , m_HalfPixelCenters(false)
919 : m_TargetShape(shape)
935 : m_BlockShape({1, 1})
936 , m_PadList({{0, 0}, {0, 0}})
941 const std::vector<std::pair<unsigned int, unsigned int>>& padList)
942 : m_BlockShape(blockShape)
958 std::vector<std::pair<unsigned int, unsigned int>>
m_PadList;
971 : m_BlockSize(blockSize)
972 , m_DataLayout(dataLayout)
994 : m_ActivationFunc(1)
995 , m_ClippingThresCell(0.0)
996 , m_ClippingThresProj(0.0)
997 , m_CifgEnabled(true)
998 , m_PeepholeEnabled(false)
999 , m_ProjectionEnabled(false)
1000 , m_LayerNormEnabled(false)
1001 , m_TimeMajor(false)
1046 , m_KeepDims(keepDims)
1066 PadDescriptor(
const std::vector<std::pair<unsigned int, unsigned int>>& padList,
1067 const float& padValue = 0,
1069 : m_PadList(padList)
1070 , m_PadValue(padValue)
1071 , m_PaddingMode(paddingMode)
1083 std::vector<std::pair<unsigned int, unsigned int>>
m_PadList;
1095 SliceDescriptor(
const std::vector<unsigned int>& begin,
const std::vector<unsigned int>& size)
1126 , m_NumInputs(numInputs)
1127 , m_InputShape(inputShape)
1132 return m_Axis == rhs.
m_Axis &&
1151 : m_NumInputs(numInputs)
1152 , m_NumOutputs(numOutputs)
1162 uint32_t m_NumInputs = 0;
1164 uint32_t m_NumOutputs = 0;
1171 const std::vector<int>& end,
1172 const std::vector<int>& stride)
1178 , m_ShrinkAxisMask(0)
1190 return m_Begin == rhs.
m_Begin &&
1191 m_End == rhs.
m_End &&
1201 int GetStartForAxis(
const TensorShape& inputShape,
unsigned int axis)
const;
1204 int startForAxis)
const;
1235 : m_NumInputSlots(numInputSlots), m_NumOutputSlots(numOutputSlots)
1249 , m_ProjectionClip(0.0)
1250 , m_CifgEnabled(true)
1251 , m_PeepholeEnabled(false)
1252 , m_ProjectionEnabled(false)
1253 , m_LayerNormEnabled(false)
1254 , m_InputIntermediateScale(0.0)
1255 , m_ForgetIntermediateScale(0.0)
1256 , m_CellIntermediateScale(0.0)
1257 , m_OutputIntermediateScale(0.0)
1258 , m_HiddenStateZeroPoint(0)
1259 , m_HiddenStateScale(0.0)
1314 m_BiasEnabled(false),
1316 m_OutputShapeEnabled(false)
1362 : m_DimMappings(dimMappings)
1383 : m_Operation(operation)
1423 : m_NumGroups(0), m_Axis(0)
1427 : m_NumGroups(numGroups), m_Axis(axis)
ElementwiseUnaryDescriptor(UnaryOperation operation)
uint32_t m_PadBottom
Padding bottom value in the height dimension.
bool m_BiasEnabled
Enable/disable bias.
float m_Eps
Used to avoid dividing by zero.
MeanDescriptor(const std::vector< unsigned int > &axis, bool keepDims)
bool m_ProjectionEnabled
Enable/disable the projection layer.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
PreCompiledDescriptor(unsigned int numInputSlots=1u, unsigned int numOutputSlots=1u)
TransposeConvolution2dDescriptor()
SliceDescriptor(const std::vector< unsigned int > &begin, const std::vector< unsigned int > &size)
UnaryOperation m_Operation
Specifies the elementwiseUnary operation to execute.
uint32_t m_Axis
0-based axis along which to stack the input tensors.
A ViewsDescriptor for the SplitterLayer.
float m_ScaleW
Center size encoding scale weight.
uint32_t m_PadBottom
Padding bottom value in the height dimension.
bool m_BiasEnabled
Enable/disable bias.
float m_K
Kappa value used for the across channel normalization equation.
int m_Axis
Scalar, defaulted to the last index (-1), specifying the dimension the activation will be performed o...
A TransposeConvolution2dDescriptor for the TransposeConvolution2dLayer.
uint32_t m_PadBottom
Padding bottom value in the height dimension.
uint32_t m_PadLeft
Padding left value in the width dimension.
float m_ClippingThresProj
Clipping threshold value for the projection.
void swap(OriginsDescriptor &first, OriginsDescriptor &second)
int32_t m_ShrinkAxisMask
Shrink axis mask value. If set, the nth specification shrinks the dimensionality by 1...
A ReshapeDescriptor for the ReshapeLayer.
NormalizationDescriptor()
std::vector< int > m_Begin
Begin values for the input that will be sliced.
uint32_t m_PadBack
Padding back value in the depth dimension.
#define ARMNN_NO_DEPRECATE_WARN_BEGIN
float m_PadValue
Optional value to use for padding, defaults to 0.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
A ComparisonDescriptor for the ComparisonLayer.
float m_ScaleX
Center size encoding scale x.
TensorShape m_InputShape
Required shape of all input tensors.
bool m_TransposeWeightMatrix
Enable/disable transpose weight matrix.
float m_Min
Minimum value.
PermuteDescriptor(const PermutationVector &dimMappings)
uint32_t m_PoolWidth
Pooling width value.
bool m_PeepholeEnabled
Enable/disable peephole.
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
A Convolution2dDescriptor for the Convolution2dLayer.
float m_Alpha
Alpha value for the normalization equation.
PadDescriptor(const std::vector< std::pair< unsigned int, unsigned int >> &padList, const float &padValue=0, const PaddingMode &paddingMode=PaddingMode::Constant)
uint32_t m_PadLeft
Padding left value in the width dimension.
bool m_KeepDims
if true then output shape has no change.
float m_HiddenStateScale
Hidden State quantization scale.
bool m_BiasEnabled
Enable/disable bias.
std::vector< unsigned int > m_OutputShape
float m_OutputIntermediateScale
Output intermediate quantization scale.
ResizeMethod m_Method
The Interpolation method to use (Bilinear, NearestNeighbor).
float m_Gamma
Gamma, the scale scalar value applied for the normalized tensor. Defaults to 1.0. ...
float m_Beta
Exponentiation value.
std::vector< unsigned int > m_Size
Size of the slice in each dimension.
ActivationDescriptor(armnn::ActivationFunction activation, float a=0, float b=0)
The padding fields don't count and are ignored.
float m_Eps
Value to add to the variance. Used to avoid dividing by zero.
PaddingMethod m_PaddingMethod
The padding method to be used. (Exclude, IgnoreValue).
ArgMinMaxFunction m_Function
Specify if the function is to find Min or Max.
uint32_t m_DetectionsPerClass
Detections per classes, used in Regular NMS.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
NormalizationAlgorithmChannel
bool m_OutputShapeEnabled
Output shape if it has been specified.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
BatchToSpaceNdDescriptor()
LogicalBinaryDescriptor()
uint32_t m_PadTop
Padding top value in the height dimension.
uint32_t m_PadBottom
Padding bottom value in the height dimension.
bool m_BiasEnabled
Enable/disable bias.
A LogicalBinaryDescriptor for the LogicalBinaryLayer.
uint32_t m_PadRight
Padding right value in the width dimension.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
std::vector< std::pair< unsigned int, unsigned int > > m_PadList
Specifies the padding for input dimension.
ReduceOperation m_ReduceOperation
Specifies the reduction operation to execute.
bool m_TimeMajor
Enable/disable time major.
ChannelShuffleDescriptor(const uint32_t &numGroups, const uint32_t &axis)
Copyright (c) 2021 ARM Limited and Contributors.
uint32_t m_PadBottom
Padding bottom value in the height dimension.
int32_t m_BeginMask
Begin mask value.
uint32_t m_DilationY
Dilation along y axis.
int32_t m_EndMask
End mask value.
A SpaceToDepthDescriptor for the SpaceToDepthLayer.
std::vector< std::pair< unsigned int, unsigned int > > m_PadList
Specifies the padding values for the input dimension: heightPad{top, bottom} widthPad{left, right}.
uint32_t m_DilationX
Dilation along x axis.
uint32_t m_DilationY
Dilation factor value for height dimension.
StridedSliceDescriptor(const std::vector< int > &begin, const std::vector< int > &end, const std::vector< int > &stride)
LogicalBinaryOperation m_Operation
Specifies the logical operation to execute.
A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
PermutationVector m_DimMappings
Indicates how to translate tensor elements from a given source into the target destination, when source and target potentially have different memory layouts e.g.
uint32_t m_StrideY
Stride value when proceeding through input for the height dimension.
uint32_t m_NumOutputs
Number of output tensors.
NormalizationAlgorithmMethod m_NormMethodType
Normalization method algorithm to use (LocalBrightness, LocalContrast).
A ResizeBilinearDescriptor for the ResizeBilinearLayer.
PaddingMethod
The padding method modifies the output of pooling layers.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
uint32_t m_MaxClassesPerDetection
Maximum numbers of classes per detection, used in Fast NMS.
Base class for all descriptors.
std::vector< unsigned int > m_Axis
Values for the dimensions to reduce.
A StackDescriptor for the StackLayer.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
L2NormalizationDescriptor()
TensorShape m_TargetShape
Target shape value.
ComparisonDescriptor(ComparisonOperation operation)
uint32_t m_PoolHeight
Pooling height value.
Convolution2dDescriptor()
uint32_t m_PadTop
Padding top value in the height dimension.
uint32_t m_MaxDetections
Maximum numbers of detections.
A PadDescriptor for the PadLayer.
FullyConnectedDescriptor()
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
bool operator==(const armnn::DataLayout &dataLayout, const DataLayoutIndexed &indexed)
Equality methods.
bool m_LayerNormEnabled
Enable/disable layer normalization.
float m_NmsIouThreshold
Intersection over union threshold.
TransposeDescriptor(const PermutationVector &dimMappings)
An LstmDescriptor for the LstmLayer.
uint32_t m_PadRight
Padding right value in the width dimension.
#define ARMNN_NO_DEPRECATE_WARN_END
uint32_t m_DilationX
Dilation factor value for width dimension.
uint32_t m_PadTop
Padding top value in the height dimension.
std::vector< unsigned int > m_Begin
Beginning indices of the slice in each dimension.
int32_t m_NewAxisMask
New axis mask value.
bool m_KeepDims
Enable/disable keep dimensions. If true, then the reduced dimensions that are of length 1 are kept...
std::vector< unsigned int > m_BlockShape
Block shape values.
float m_Eps
Epsilon, small scalar value added to variance to avoid dividing by zero. Defaults to 1e-12f...
A L2NormalizationDescriptor for the L2NormalizationLayer.
An ArgMinMaxDescriptor for ArgMinMaxLayer.
An OriginsDescriptor for the ConcatLayer.
A ReduceDescriptor for the REDUCE operators.
float m_ProjectionClip
Clipping threshold value for the projection.
A FullyConnectedDescriptor for the FullyConnectedLayer.
ChannelShuffleDescriptor()
int32_t m_EllipsisMask
Ellipsis mask value.
bool m_BiasEnabled
Enable/disable bias.
float m_InputIntermediateScale
Input intermediate quantization scale.
A FakeQuantizationDescriptor for the FakeQuantizationLayer.
DepthwiseConvolution2dDescriptor()
SpaceToBatchNdDescriptor()
uint32_t m_TargetWidth
Target width value.
A GatherDescriptor for the GatherLayer.
bool m_PeepholeEnabled
Enable/disable peephole.
uint32_t m_NumClasses
Number of classes.
bool m_HalfPixelCenters
Half Pixel Centers.
uint32_t m_PadTop
Padding top value in the height dimension.
A StandInDescriptor for the StandIn layer.
A QLstmDescriptor for the QLstmLayer.
unsigned int m_NumInputSlots
bool m_UseRegularNms
Use Regular NMS.
uint32_t m_PadFront
Padding front value in the depth dimension.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
std::vector< unsigned int > m_BlockShape
Block shape value.
std::vector< int > m_Stride
Stride values for the input that will be sliced.
class ARMNN_DEPRECATED_MSG_REMOVAL_DATE("Use ABI stable IStrategy instead.", "22.05") ILayerVisitor
PaddingMode
The padding mode controls whether the padding should be filled with constant values (Constant)...
An ActivationDescriptor for the ActivationLayer.
SpaceToBatchNdDescriptor(const std::vector< unsigned int > &blockShape, const std::vector< std::pair< unsigned int, unsigned int >> &padList)
uint32_t m_NumInputs
Number of input tensors.
uint32_t m_PadLeft
Padding left value in the width dimension.
uint32_t m_TargetHeight
Target height value.
uint32_t m_ActivationFunc
The activation function to use.
A SliceDescriptor for the SliceLayer.
uint32_t m_StrideY
Stride value when proceeding through input for the height dimension.
ElementwiseUnaryDescriptor()
A Convolution3dDescriptor for the Convolution3dLayer.
uint32_t m_PadRight
Padding right value in the width dimension.
float m_ClippingThresCell
Clipping threshold value for the cell state.
unsigned int m_BlockSize
Scalar specifying the input block size. It must be >= 1.
uint32_t m_NumGroups
Number of groups for the channel shuffle operation.
PaddingMode m_PaddingMode
Specifies the Padding mode (Constant, Reflect or Symmetric)
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
float m_ForgetIntermediateScale
Forget intermediate quantization scale.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
float m_Beta
Beta, the offset scalar value applied for the normalized tensor. Defaults to 1.0. ...
InstanceNormalizationDescriptor()
std::vector< uint32_t > m_vAxis
The indices of the dimensions to reduce.
float m_ScaleH
Center size encoding scale height.
ComparisonOperation m_Operation
Specifies the comparison operation to execute.
std::vector< int > m_End
End values for the input that will be sliced.
A SpaceToBatchNdDescriptor for the SpaceToBatchNdLayer.
DataLayout m_DataLayout
The data layout to be used (NDHWC, NCDHW).
NormalizationAlgorithmChannel m_NormChannelType
Normalization channel algorithm to use (Across, Within).
float m_CellClip
Clipping threshold value for the cell state.
float m_A
Alpha upper bound value used by the activation functions. (BoundedReLu, Linear, TanH, Elu).
uint32_t m_DilationX
Dilation along x axis.
FillDescriptor(const float &value)
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
bool m_CifgEnabled
Enable/disable cifg (coupled input & forget gate).
StandInDescriptor(uint32_t numInputs, uint32_t numOutputs)
uint32_t m_PadLeft
Padding left value in the width dimension.
bool m_AlignCorners
Aligned corners.
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
int32_t m_Axis
The axis in params to gather indices from.
A ElementwiseUnaryDescriptor for the ElementwiseUnaryLayer.
PoolingAlgorithm m_PoolType
The pooling algorithm to use (Max. Average, L2).
uint32_t m_StrideY
Stride value when proceeding through input for the height dimension.
uint32_t m_StrideY
Stride value when proceeding through input for the height dimension.
SpaceToDepthDescriptor(unsigned int blockSize, DataLayout dataLayout)
std::vector< std::pair< unsigned int, unsigned int > > m_Crops
The values to crop from the input dimension.
uint32_t m_PadTop
Padding top value in the height dimension.
bool m_ProjectionEnabled
Enable/disable the projection layer.
OutputShapeRounding m_OutputShapeRounding
The rounding method for the output shape. (Floor, Ceiling).
uint32_t m_NumInputs
Number of input tensors.
FakeQuantizationDescriptor()
void SetConcatAxis(unsigned int concatAxis)
Set the concatenation axis value.
A MeanDescriptor for the MeanLayer.
Convolution3dDescriptor()
bool m_LayerNormEnabled
Enable/disable layer normalization.
uint32_t m_PadRight
Padding right value in the width dimension.
A TransposeDescriptor for the TransposeLayer.
A StridedSliceDescriptor for the StridedSliceLayer.
uint32_t m_Axis
Axis to apply channel shuffle operation on.
int m_Axis
Axis to reduce across the input tensor.
float m_ScaleY
Center size encoding scale y.
OriginsDescriptor CreateDescriptorForConcatenation(TensorShapeIt first, TensorShapeIt last, unsigned int concatenationDimension)
Convenience template to create an OriginsDescriptor to use when creating a ConcatLayer for performing...
float m_NmsScoreThreshold
NMS score threshold.
A PreCompiledDescriptor for the PreCompiledLayer.
GatherDescriptor(int32_t axis)
Krichevsky 2012: Local Brightness Normalization.
A Pooling2dDescriptor for the Pooling2dLayer.
A NormalizationDescriptor for the NormalizationLayer.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
An InstanceNormalizationDescriptor for InstanceNormalizationLayer.
NormalizationAlgorithmMethod
unsigned int m_NumOutputSlots
A ChannelShuffleDescriptor for the ChannelShuffle operator.
StackDescriptor(uint32_t axis, uint32_t numInputs, const TensorShape &inputShape)
ReshapeDescriptor(const TensorShape &shape)
float m_CellIntermediateScale
Cell intermediate quantization scale.
LogicalBinaryDescriptor(LogicalBinaryOperation operation)
DetectionPostProcessDescriptor()
uint32_t m_DilationZ
Dilation along z axis.
float m_B
Beta lower bound value used by the activation functions. (BoundedReLu, Linear, TanH).
A SoftmaxDescriptor for the SoftmaxLayer.
float m_Beta
Beta value for the normalization equation.
float m_Max
Maximum value.
uint32_t m_StrideZ
Stride value when proceeding through input for the depth dimension.
BatchToSpaceNdDescriptor(std::vector< unsigned int > blockShape, std::vector< std::pair< unsigned int, unsigned int >> crops)
bool m_CifgEnabled
Enable/disable CIFG (coupled input & forget gate).
PermutationVector m_DimMappings
Indicates how to translate tensor elements from a given source into the target destination, when source and target potentially have different memory layouts e.g.
uint32_t m_NormSize
Depth radius value.
ActivationFunction m_Function
The activation function to use (Sigmoid, TanH, Linear, ReLu, BoundedReLu, SoftReLu, LeakyReLu, Abs, Sqrt, Square, Elu).
armnn::DataType m_Output_Type
Deprecated and will be removed in future release.
uint32_t m_StrideY
Stride value when proceeding through input for the height dimension.
A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.
uint32_t m_DilationY
Dilation along y axis.
A FillDescriptor for the FillLayer.
A BatchNormalizationDescriptor for the BatchNormalizationLayer.
uint32_t m_PadLeft
Padding left value in the width dimension.
Status SetViewOriginCoord(uint32_t view, uint32_t coord, uint32_t value)
Set the view origin coordinates.
A PermuteDescriptor for the PermuteLayer.
uint32_t m_PadRight
Padding right value in the width dimension.
int32_t m_HiddenStateZeroPoint
Hidden State zero point.
bool m_ConstantWeights
Enable/disable constant weights and biases.
BatchNormalizationDescriptor()