13 #define TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(name) \ 14 BOOST_AUTO_TEST_CASE(Check##name##LayerVisitorNameAndDescriptor) \ 16 const char* layerName = "name##Layer"; \ 17 armnn::name##Descriptor descriptor = GetDescriptor<armnn::name##Descriptor>(); \ 18 Test##name##LayerVisitor visitor(descriptor, layerName); \ 20 armnn::IConnectableLayer *const layer = net.Add##name##Layer(descriptor, layerName); \ 21 layer->Accept(visitor); \ 24 #define TEST_CASE_CHECK_LAYER_VISITOR_NAME_NULLPTR_AND_DESCRIPTOR(name) \ 25 BOOST_AUTO_TEST_CASE(Check##name##LayerVisitorNameNullptrAndDescriptor) \ 27 armnn::name##Descriptor descriptor = GetDescriptor<armnn::name##Descriptor>(); \ 28 Test##name##LayerVisitor visitor(descriptor); \ 30 armnn::IConnectableLayer *const layer = net.Add##name##Layer(descriptor); \ 31 layer->Accept(visitor); \ 34 #define TEST_SUITE_NAME_AND_DESCRIPTOR_LAYER_VISITOR(name) \ 35 TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(name) \ 36 TEST_CASE_CHECK_LAYER_VISITOR_NAME_NULLPTR_AND_DESCRIPTOR(name) 38 template<
typename Descriptor> Descriptor GetDescriptor();
45 descriptor.
m_A = 2.0f;
46 descriptor.
m_B = 2.0f;
77 for (
unsigned int i = 0u; i < descriptor.GetNumViews(); ++i)
79 for (
unsigned int j = 0u; j < descriptor.GetNumDimensions(); ++j)
81 descriptor.SetViewOriginCoord(i, j, i);
100 descriptor.
m_Eps = 0.0001f;
110 descriptor.
m_Eps = 0.0001f;
131 descriptor.
m_K = 1.0f;
218 for (
unsigned int i = 0u; i < descriptor.GetNumViews(); ++i)
220 for (
unsigned int j = 0u; j < descriptor.GetNumDimensions(); ++j)
222 descriptor.SetViewOriginCoord(i, j, i);
223 descriptor.SetViewSize(i, j, 1);
241 descriptor.m_EndMask = 1;
242 descriptor.m_ShrinkAxisMask = 1;
243 descriptor.m_EllipsisMask = 1;
244 descriptor.m_NewAxisMask = 1;
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
float m_Eps
Used to avoid dividing by zero.
A ViewsDescriptor for the SplitterLayer.
uint32_t m_PadBottom
Padding bottom value in the height dimension.
void Slice(const TensorInfo &inputInfo, const SliceDescriptor &descriptor, const void *inputData, void *outputData, unsigned int dataTypeSize)
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...
uint32_t m_PadLeft
Padding left value in the width dimension.
A ReshapeDescriptor for the ReshapeLayer.
void ArgMinMax(Decoder< float > &in, int32_t *out, const TensorInfo &inputTensorInfo, const TensorInfo &outputTensorInfo, ArgMinMaxFunction function, int axis)
A ComparisonDescriptor for the ComparisonLayer.
uint32_t m_PoolWidth
Pooling width value.
float m_Alpha
Alpha value for the normalization equation.
float m_Gamma
Gamma, the scale scalar value applied for the normalized tensor. Defaults to 1.0. ...
float m_Beta
Exponentiation value.
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_PadTop
Padding top value in the height dimension.
void Transpose(const armnn::TensorShape &dstShape, const armnn::PermutationVector &mappings, const void *src, void *dst, size_t dataTypeSize)
void DepthToSpace(const TensorInfo &inputInfo, const DepthToSpaceDescriptor &descriptor, const void *inputData, void *outputData, unsigned int dataTypeSize)
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
int32_t m_BeginMask
Begin mask value.
A SpaceToDepthDescriptor for the SpaceToDepthLayer.
A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
void Stack(const StackQueueDescriptor &data, std::vector< std::unique_ptr< Decoder< float >>> &inputs, Encoder< float > &output)
NormalizationAlgorithmMethod m_NormMethodType
Normalization method algorithm to use (LocalBrightness, LocalContrast).
A ResizeDescriptor for the ResizeLayer.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
A StackDescriptor for the StackLayer.
void Pad(const TensorInfo &inputInfo, const TensorInfo &outputInfo, std::vector< std::pair< unsigned int, unsigned int >> m_padList, const T *inputData, T *outData, const float padValue)
uint32_t m_PoolHeight
Pooling height value.
A PadDescriptor for the PadLayer.
void Permute(const armnn::TensorShape &dstShape, const armnn::PermutationVector &mappings, const void *src, void *dst, size_t dataTypeSize)
uint32_t m_PadRight
Padding right value in the width dimension.
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.
uint32_t m_TargetWidth
Target width value.
float Activation(float in, ActivationFunction function, float a, float b)
void Resize(Decoder< float > &in, const TensorInfo &inputInfo, Encoder< float > &out, const TensorInfo &outputInfo, DataLayoutIndexed dataLayout, armnn::ResizeMethod resizeMethod, bool alignCorners)
void LogSoftmax(Decoder< float > &input, Encoder< float > &output, const TensorInfo &inputInfo, const LogSoftmaxDescriptor &descriptor)
An ActivationDescriptor for the ActivationLayer.
uint32_t m_TargetHeight
Target height value.
A SliceDescriptor for the SliceLayer.
void SpaceToBatchNd(const TensorInfo &inputInfo, const TensorInfo &outputInfo, const SpaceToBatchNdDescriptor ¶ms, Decoder< float > &inputData, Encoder< float > &outputData)
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. ...
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).
BOOST_AUTO_TEST_SUITE_END()
void StridedSlice(const TensorInfo &inputInfo, const StridedSliceDescriptor ¶ms, const void *inputData, void *outputData, unsigned int dataTypeSize)
A ElementwiseUnaryDescriptor for the ElementwiseUnaryLayer.
PoolingAlgorithm m_PoolType
The pooling algorithm to use (Max. Average, L2).
The padding fields count, but are ignored.
Jarret 2009: Local Contrast Normalization.
OutputShapeRounding m_OutputShapeRounding
The rounding method for the output shape. (Floor, Ceiling).
A MeanDescriptor for the MeanLayer.
void Mean(const armnn::TensorInfo &inputInfo, const armnn::TensorInfo &outputInfo, const std::vector< unsigned int > &axis, Decoder< float > &input, Encoder< float > &output)
A TransposeDescriptor for the TransposeLayer.
A StridedSliceDescriptor for the StridedSliceLayer.
int m_Axis
Axis to reduce across the input tensor.
void SpaceToDepth(const TensorInfo &inputInfo, const TensorInfo &outputInfo, const SpaceToDepthDescriptor ¶ms, Decoder< float > &inputData, Encoder< float > &outputData)
void BatchToSpaceNd(const DataLayoutIndexed &dataLayout, const TensorInfo &inputTensorInfo, const TensorInfo &outputTensorInfo, const std::vector< unsigned int > &blockShape, const std::vector< std::pair< unsigned int, unsigned int >> &cropsData, Decoder< float > &inputDecoder, Encoder< float > &outputEncoder)
A Pooling2dDescriptor for the Pooling2dLayer.
A NormalizationDescriptor for the NormalizationLayer.
void Pooling2d(Decoder< float > &rInputDecoder, Encoder< float > &rOutputEncoder, const TensorInfo &inputInfo, const TensorInfo &outputInfo, const Pooling2dDescriptor ¶ms)
Computes the Pooling2d operation.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
An InstanceNormalizationDescriptor for InstanceNormalizationLayer.
void Splitter(const SplitterQueueDescriptor &data)
void Softmax(Decoder< float > &in, Encoder< float > &out, const TensorInfo &inputTensorInfo, float beta, int axis)
Computes the softmax function on some inputs, into outputs, with a shape given by tensorInfo...
#define TEST_SUITE_NAME_AND_DESCRIPTOR_LAYER_VISITOR(name)
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.
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 PermuteDescriptor for the PermuteLayer.