11 #include <initializer_list> 69 : m_Operation(operation)
89 : m_Operation(operation)
109 : m_DimMappings(dimMappings)
163 Status SetViewOriginCoord(uint32_t view, uint32_t coord, uint32_t value);
165 uint32_t GetNumViews()
const;
167 uint32_t GetNumDimensions()
const;
169 const uint32_t* GetViewOrigin(uint32_t idx)
const;
172 void ReorderOrigins(
unsigned int* newOrdering,
unsigned int numNewOrdering);
176 void SetConcatAxis(
unsigned int concatAxis);
178 unsigned int GetConcatAxis()
const;
181 unsigned int m_ConcatAxis;
183 uint32_t m_NumDimensions;
184 uint32_t** m_ViewOrigins;
206 Status SetViewOriginCoord(uint32_t view, uint32_t coord, uint32_t value);
210 Status SetViewSize(uint32_t view, uint32_t coord, uint32_t value);
213 uint32_t GetNumViews()
const;
215 uint32_t GetNumDimensions()
const;
217 const uint32_t* GetViewOrigin(uint32_t idx)
const;
219 const uint32_t* GetViewSizes(uint32_t idx)
const;
227 uint32_t** m_ViewSizes;
230 template <
typename TensorShapeIt>
234 unsigned int concatenationDimension)
241 template <
typename TensorShapeIt>
244 unsigned int concatenationDimension)
246 auto numInputs = std::distance(first, last);
253 const auto& firstInputShape = *first;
255 const unsigned int numDimensions = firstInputShape.GetNumDimensions();
256 for (
auto it = first + 1; it != last; ++it)
258 if (it->GetNumDimensions() != numDimensions)
264 if (concatenationDimension >= numDimensions)
269 for (
auto it = first; it != last; ++it)
271 for (
unsigned int d = 0; d < numDimensions; ++d)
273 const bool dimSizeOk = (d == concatenationDimension) || (firstInputShape[d] == (*it)[d]);
277 " except the concatenation dimension");
282 OriginsDescriptor viewsDescriptor(static_cast<uint32_t>(numInputs), numDimensions);
285 uint32_t viewIndex = 0u;
286 uint32_t coordAlongConcatDim = 0u;
287 for (
auto it = first; it != last; ++it)
289 const auto& inputShape = *it;
291 for (
unsigned int i = 0; i < concatenationDimension; ++i)
296 viewsDescriptor.
SetViewOriginCoord(viewIndex, concatenationDimension, coordAlongConcatDim);
297 unsigned int dimSize = inputShape[concatenationDimension];
298 coordAlongConcatDim += dimSize;
301 for (
unsigned int i = concatenationDimension + 1; i < numDimensions; ++i)
309 return viewsDescriptor;
376 : m_BiasEnabled(
false)
377 , m_TransposeWeightMatrix(
false)
403 , m_BiasEnabled(
false)
455 , m_BiasEnabled(
false)
499 , m_MaxClassesPerDetection(1)
500 , m_DetectionsPerClass(1)
501 , m_NmsScoreThreshold(0)
502 , m_NmsIouThreshold(0)
504 , m_UseRegularNms(
false)
640 return m_Gamma == rhs.
m_Gamma &&
642 m_Eps == rhs.
m_Eps &&
660 : m_BlockShape({1, 1})
661 , m_Crops({{0, 0}, {0, 0}})
666 std::vector<std::pair<unsigned int, unsigned int>> crops)
667 : m_BlockShape(blockShape)
682 std::vector<std::pair<unsigned int, unsigned int>>
m_Crops;
697 return m_Min == rhs.
m_Min && m_Max == rhs.
m_Max;
731 , m_BilinearAlignCorners(
false)
765 : m_TargetShape(shape)
781 : m_BlockShape({1, 1})
782 , m_PadList({{0, 0}, {0, 0}})
787 const std::vector<std::pair<unsigned int, unsigned int>>& padList)
788 : m_BlockShape(blockShape)
804 std::vector<std::pair<unsigned int, unsigned int>>
m_PadList;
817 : m_BlockSize(blockSize)
818 , m_DataLayout(dataLayout)
840 : m_ActivationFunc(1)
841 , m_ClippingThresCell(0.0)
842 , m_ClippingThresProj(0.0)
843 , m_CifgEnabled(
true)
844 , m_PeepholeEnabled(
false)
845 , m_ProjectionEnabled(
false)
846 , m_LayerNormEnabled(
false)
886 , m_KeepDims(keepDims)
906 PadDescriptor(
const std::vector<std::pair<unsigned int, unsigned int>>& padList,
const float& padValue = 0)
908 , m_PadValue(padValue)
920 std::vector<std::pair<unsigned int, unsigned int>>
m_PadList;
929 SliceDescriptor(
const std::vector<unsigned int>& begin,
const std::vector<unsigned int>& size)
960 , m_NumInputs(numInputs)
961 , m_InputShape(inputShape)
966 return m_Axis == rhs.
m_Axis &&
985 : m_NumInputs(numInputs)
986 , m_NumOutputs(numOutputs)
996 uint32_t m_NumInputs = 0;
998 uint32_t m_NumOutputs = 0;
1005 const std::vector<int>& end,
1006 const std::vector<int>& stride)
1012 , m_ShrinkAxisMask(0)
1024 return m_Begin == rhs.
m_Begin &&
1025 m_End == rhs.
m_End &&
1035 int GetStartForAxis(
const TensorShape& inputShape,
unsigned int axis)
const;
1038 int startForAxis)
const;
1069 : m_NumInputSlots(numInputSlots), m_NumOutputSlots(numOutputSlots)
1088 m_BiasEnabled(
false),
1130 : 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_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.
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.
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_BiasEnabled
Enable/disable bias.
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.
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
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.
DataLayout::NCHW DataLayout::NCHW DataLayout::NHWC DataLayout::NHWC true
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.
float m_NmsIouThreshold
Intersection over union threshold.
bool m_BilinearAlignCorners
Aligned corners for bilinear method.
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 FullyConnectedDescriptor for the FullyConnectedLayer.
int32_t m_EllipsisMask
Ellipsis mask value.
bool m_BiasEnabled
Enable/disable bias.
A FakeQuantizationDescriptor for the FakeQuantizationLayer.
DepthwiseConvolution2dDescriptor()
SpaceToBatchNdDescriptor()
uint32_t m_TargetWidth
Target width value.
bool m_PeepholeEnabled
Enable/disable peephole.
uint32_t m_NumClasses
Number of classes.
uint32_t m_PadTop
Padding top value in the height dimension.
A StandInDescriptor for the StandIn layer.
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).
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_A
Alpha upper bound value used by the activation functions. (BoundedReLu, Linear, TanH).
uint32_t m_DilationX
Dilation along x axis.
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.
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
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.
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.
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)
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.
BatchToSpaceNdDescriptor(std::vector< unsigned int > blockShape, std::vector< std::pair< unsigned int, unsigned int >> crops)
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).
uint32_t m_StrideY
Stride value when proceeding through input for the height dimension.
A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.
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.
BatchNormalizationDescriptor()