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;
246 template <
typename TensorShapeIt>
250 unsigned int concatenationDimension)
257 template <
typename TensorShapeIt>
260 unsigned int concatenationDimension)
262 auto numInputs = std::distance(first, last);
269 const auto& firstInputShape = *first;
271 const unsigned int numDimensions = firstInputShape.GetNumDimensions();
272 for (
auto it = first + 1; it != last; ++it)
274 if (it->GetNumDimensions() != numDimensions)
280 if (concatenationDimension >= numDimensions)
285 for (
auto it = first; it != last; ++it)
287 for (
unsigned int d = 0; d < numDimensions; ++d)
289 const bool dimSizeOk = (d == concatenationDimension) || (firstInputShape[d] == (*it)[d]);
293 " except the concatenation dimension");
298 OriginsDescriptor viewsDescriptor(static_cast<uint32_t>(numInputs), numDimensions);
301 uint32_t viewIndex = 0u;
302 uint32_t coordAlongConcatDim = 0u;
303 for (
auto it = first; it != last; ++it)
305 const auto& inputShape = *it;
307 for (
unsigned int i = 0; i < concatenationDimension; ++i)
312 viewsDescriptor.
SetViewOriginCoord(viewIndex, concatenationDimension, coordAlongConcatDim);
313 unsigned int dimSize = inputShape[concatenationDimension];
314 coordAlongConcatDim += dimSize;
317 for (
unsigned int i = concatenationDimension + 1; i < numDimensions; ++i)
325 return viewsDescriptor;
392 : m_BiasEnabled(
false)
393 , m_TransposeWeightMatrix(
false)
394 , m_ConstantWeights(
true)
405 uint32_t GetNumViews()
const;
427 , m_BiasEnabled(
false)
479 , m_BiasEnabled(
false)
523 , m_MaxClassesPerDetection(1)
524 , m_DetectionsPerClass(1)
525 , m_NmsScoreThreshold(0)
526 , m_NmsIouThreshold(0)
528 , m_UseRegularNms(
false)
664 return m_Gamma == rhs.
m_Gamma &&
666 m_Eps == rhs.
m_Eps &&
684 : m_BlockShape({1, 1})
685 , m_Crops({{0, 0}, {0, 0}})
690 std::vector<std::pair<unsigned int, unsigned int>> crops)
691 : m_BlockShape(blockShape)
706 std::vector<std::pair<unsigned int, unsigned int>>
m_Crops;
721 return m_Min == rhs.
m_Min && m_Max == rhs.
m_Max;
762 return m_Axis == rhs.
m_Axis;
776 , m_AlignCorners(
false)
777 , m_HalfPixelCenters(
false)
809 , m_AlignCorners(
false)
810 , m_HalfPixelCenters(
false)
847 : m_TargetShape(shape)
863 : m_BlockShape({1, 1})
864 , m_PadList({{0, 0}, {0, 0}})
869 const std::vector<std::pair<unsigned int, unsigned int>>& padList)
870 : m_BlockShape(blockShape)
886 std::vector<std::pair<unsigned int, unsigned int>>
m_PadList;
899 : m_BlockSize(blockSize)
900 , m_DataLayout(dataLayout)
922 : m_ActivationFunc(1)
923 , m_ClippingThresCell(0.0)
924 , m_ClippingThresProj(0.0)
925 , m_CifgEnabled(
true)
926 , m_PeepholeEnabled(
false)
927 , m_ProjectionEnabled(
false)
928 , m_LayerNormEnabled(
false)
968 , m_KeepDims(keepDims)
988 PadDescriptor(
const std::vector<std::pair<unsigned int, unsigned int>>& padList,
const float& padValue = 0)
990 , m_PadValue(padValue)
1002 std::vector<std::pair<unsigned int, unsigned int>>
m_PadList;
1011 SliceDescriptor(
const std::vector<unsigned int>& begin,
const std::vector<unsigned int>& size)
1042 , m_NumInputs(numInputs)
1043 , m_InputShape(inputShape)
1048 return m_Axis == rhs.
m_Axis &&
1067 : m_NumInputs(numInputs)
1068 , m_NumOutputs(numOutputs)
1078 uint32_t m_NumInputs = 0;
1080 uint32_t m_NumOutputs = 0;
1087 const std::vector<int>& end,
1088 const std::vector<int>& stride)
1094 , m_ShrinkAxisMask(0)
1106 return m_Begin == rhs.
m_Begin &&
1107 m_End == rhs.
m_End &&
1117 int GetStartForAxis(
const TensorShape& inputShape,
unsigned int axis)
const;
1120 int startForAxis)
const;
1151 : m_NumInputSlots(numInputSlots), m_NumOutputSlots(numOutputSlots)
1165 , m_ProjectionClip(0.0)
1166 , m_CifgEnabled(
true)
1167 , m_PeepholeEnabled(
false)
1168 , m_ProjectionEnabled(
false)
1169 , m_LayerNormEnabled(
false)
1170 , m_InputIntermediateScale(0.0)
1171 , m_ForgetIntermediateScale(0.0)
1172 , m_CellIntermediateScale(0.0)
1173 , m_OutputIntermediateScale(0.0)
1174 , m_HiddenStateZeroPoint(0)
1175 , m_HiddenStateScale(0.0)
1230 m_BiasEnabled(
false),
1232 m_OutputShapeEnabled(
false)
1278 : m_DimMappings(dimMappings)
1299 : m_Operation(operation)
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_HalfPixelCenters
Half Pixel Centers.
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)
bool m_AlignCorners
Aligned corners.
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.
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.
uint32_t m_TargetWidth
Target width value.
bool m_TransposeWeightMatrix
Enable/disable transpose weight matrix.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
float m_Min
Minimum value.
PermuteDescriptor(const PermutationVector &dimMappings)
uint32_t m_PoolWidth
Pooling width value.
bool m_PeepholeEnabled
Enable/disable peephole.
A Convolution2dDescriptor for the Convolution2dLayer.
float m_Alpha
Alpha value for the normalization equation.
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.
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.
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_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.
OriginsDescriptor CreateMergerDescriptorForConcatenation(TensorShapeIt first, TensorShapeIt last, unsigned int concatenationDimension)
uint32_t m_NumOutputs
Number of output tensors.
NormalizationAlgorithmMethod m_NormMethodType
Normalization method algorithm to use (LocalBrightness, LocalContrast).
A ResizeDescriptor for the ResizeLayer.
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.
uint32_t m_DilationX
Dilation factor value for width dimension.
uint32_t m_PadTop
Padding top value in the height dimension.
PadDescriptor(const std::vector< std::pair< unsigned int, unsigned int >> &padList, const float &padValue=0)
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.
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.
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.
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_TargetHeight
Target height value.
uint32_t m_NumInputs
Number of input tensors.
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()
float m_ClippingThresCell
Clipping threshold value for the cell state.
unsigned int m_BlockSize
Scalar specifying the input block size. It must be >= 1.
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.
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)
ResizeBilinearDescriptor()
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.
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.
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.
int m_Axis
Axis to reduce across the input tensor.
float m_ScaleY
Center size encoding scale y.
#define ARMNN_DEPRECATED_MSG(message)
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 ResizeBilinearDescriptor for the ResizeBilinearLayer.
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()
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.
DataLayout::NCHW DataLayout::NCHW DataLayout::NHWC DataLayout::NHWC true
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.
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()