11 #include <initializer_list> 77 : m_Operation(operation)
97 : m_Operation(operation)
117 : m_DimMappings(dimMappings)
171 Status SetViewOriginCoord(uint32_t view, uint32_t coord, uint32_t value);
173 uint32_t GetNumViews()
const;
175 uint32_t GetNumDimensions()
const;
177 const uint32_t* GetViewOrigin(uint32_t idx)
const;
180 void ReorderOrigins(
unsigned int* newOrdering,
unsigned int numNewOrdering);
184 void SetConcatAxis(
unsigned int concatAxis);
186 unsigned int GetConcatAxis()
const;
189 unsigned int m_ConcatAxis;
191 uint32_t m_NumDimensions;
192 uint32_t** m_ViewOrigins;
214 Status SetViewOriginCoord(uint32_t view, uint32_t coord, uint32_t value);
218 Status SetViewSize(uint32_t view, uint32_t coord, uint32_t value);
221 uint32_t GetNumViews()
const;
223 uint32_t GetNumDimensions()
const;
225 const uint32_t* GetViewOrigin(uint32_t idx)
const;
227 const uint32_t* GetViewSizes(uint32_t idx)
const;
235 uint32_t** m_ViewSizes;
238 template <
typename TensorShapeIt>
242 unsigned int concatenationDimension)
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)
411 , m_BiasEnabled(
false)
463 , m_BiasEnabled(
false)
507 , m_MaxClassesPerDetection(1)
508 , m_DetectionsPerClass(1)
509 , m_NmsScoreThreshold(0)
510 , m_NmsIouThreshold(0)
512 , m_UseRegularNms(
false)
648 return m_Gamma == rhs.
m_Gamma &&
650 m_Eps == rhs.
m_Eps &&
668 : m_BlockShape({1, 1})
669 , m_Crops({{0, 0}, {0, 0}})
674 std::vector<std::pair<unsigned int, unsigned int>> crops)
675 : m_BlockShape(blockShape)
690 std::vector<std::pair<unsigned int, unsigned int>>
m_Crops;
705 return m_Min == rhs.
m_Min && m_Max == rhs.
m_Max;
746 return m_Axis == rhs.
m_Axis;
760 , m_AlignCorners(
false)
761 , m_HalfPixelCenters(
false)
784 , m_AlignCorners(
false)
785 , m_HalfPixelCenters(
false)
822 : m_TargetShape(shape)
838 : m_BlockShape({1, 1})
839 , m_PadList({{0, 0}, {0, 0}})
844 const std::vector<std::pair<unsigned int, unsigned int>>& padList)
845 : m_BlockShape(blockShape)
861 std::vector<std::pair<unsigned int, unsigned int>>
m_PadList;
874 : m_BlockSize(blockSize)
875 , m_DataLayout(dataLayout)
897 : m_ActivationFunc(1)
898 , m_ClippingThresCell(0.0)
899 , m_ClippingThresProj(0.0)
900 , m_CifgEnabled(
true)
901 , m_PeepholeEnabled(
false)
902 , m_ProjectionEnabled(
false)
903 , m_LayerNormEnabled(
false)
943 , m_KeepDims(keepDims)
963 PadDescriptor(
const std::vector<std::pair<unsigned int, unsigned int>>& padList,
const float& padValue = 0)
965 , m_PadValue(padValue)
977 std::vector<std::pair<unsigned int, unsigned int>>
m_PadList;
986 SliceDescriptor(
const std::vector<unsigned int>& begin,
const std::vector<unsigned int>& size)
1017 , m_NumInputs(numInputs)
1018 , m_InputShape(inputShape)
1023 return m_Axis == rhs.
m_Axis &&
1042 : m_NumInputs(numInputs)
1043 , m_NumOutputs(numOutputs)
1053 uint32_t m_NumInputs = 0;
1055 uint32_t m_NumOutputs = 0;
1062 const std::vector<int>& end,
1063 const std::vector<int>& stride)
1069 , m_ShrinkAxisMask(0)
1081 return m_Begin == rhs.
m_Begin &&
1082 m_End == rhs.
m_End &&
1092 int GetStartForAxis(
const TensorShape& inputShape,
unsigned int axis)
const;
1095 int startForAxis)
const;
1126 : m_NumInputSlots(numInputSlots), m_NumOutputSlots(numOutputSlots)
1140 , m_ProjectionClip(0.0)
1141 , m_CifgEnabled(
true)
1142 , m_PeepholeEnabled(
false)
1143 , m_ProjectionEnabled(
false)
1144 , m_LayerNormEnabled(
false)
1145 , m_InputIntermediateScale(0.0)
1146 , m_ForgetIntermediateScale(0.0)
1147 , m_CellIntermediateScale(0.0)
1148 , m_OutputIntermediateScale(0.0)
1149 , m_HiddenStateZeroPoint(0)
1150 , m_HiddenStateScale(0.0)
1205 m_BiasEnabled(
false),
1207 m_OutputShapeEnabled(
false)
1253 : m_DimMappings(dimMappings)
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.
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()
bool operator==(const ActivationDescriptor &rhs) const
uint32_t m_PadTop
Padding top value in the height dimension.
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.
Copyright (c) 2020 ARM Limited.
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)
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.
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 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.
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()
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.
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).
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.
BatchNormalizationDescriptor()