6 #include <boost/test/unit_test.hpp> 18 using namespace armnn;
22 constexpr
const bool maskPermutations[6][4] = {{
false,
false,
false,
false},
23 {
true,
false,
false,
false},
24 {
false,
true,
false,
false},
25 {
false,
false,
true,
false},
26 {
false,
false,
false,
true},
27 {
true,
true,
true,
true}};
29 template<
typename LayerT,
typename... Args>
30 LayerT* BuildGraph(
Graph* graph,
const std::vector<TensorShape>& inputShapes, Args &&... args)
32 auto layer = graph->
AddLayer<LayerT>(std::forward<Args>(args)...);
34 uint32_t inputCount = 0;
35 for (
auto inputShape : inputShapes)
39 auto input = graph->AddLayer<
InputLayer>(
static_cast<int>(inputCount),
"input");
40 input->GetOutputSlot().SetTensorInfo(inputTensorInfo);
41 input->GetOutputSlot().Connect(layer->GetInputSlot(inputCount));
48 template<
typename LayerT>
49 void RunShapeInferenceTest(LayerT*
const layer,
50 const std::vector<std::initializer_list<unsigned int>> dimensionSizeLists)
52 std::vector<unsigned int> numDimensions;
53 std::vector<TensorShape> expectedOutputShapes;
55 for (
auto dimensionSizeList : dimensionSizeLists)
57 numDimensions.emplace_back(dimensionSizeList.size());
58 expectedOutputShapes.emplace_back(
TensorShape(dimensionSizeList));
61 const unsigned int outputSize = layer->GetNumOutputSlots();
63 const auto runTestWithMask = [&](
const bool maskPermutations[])
65 for (
unsigned int i = 0; i < outputSize; ++i)
67 layer->GetOutputSlot(i).SetTensorInfo({{numDimensions[i], dimensionSizeLists[i].begin(), maskPermutations},
71 layer->ValidateTensorShapesFromInputs();
73 for (
unsigned int i = 0; i < outputSize; ++i)
75 BOOST_CHECK(layer->GetOutputSlot(i).GetTensorInfo().GetShape() == expectedOutputShapes[i]);
80 for (
unsigned int j = 0; j < outputSize; ++j)
90 layer->ValidateTensorShapesFromInputs();
92 for (
unsigned int i = 0; i < outputSize; ++i)
94 BOOST_CHECK(layer->GetOutputSlot(i).GetTensorInfo().GetShape() == expectedOutputShapes[i]);
98 for (
unsigned int i = 0; i < numDimensions[0]; ++i)
100 runTestWithMask(maskPermutations[i]);
104 runTestWithMask(maskPermutations[5]);
107 template<
typename LayerT,
typename... Args>
108 void CreateGraphAndRunTest(
const std::vector<TensorShape>& inputShapes,
109 const std::vector<std::initializer_list<unsigned int>> dimensionSizeLists,
114 auto layer = BuildGraph<LayerT>(&graph, inputShapes, std::forward<Args>(args)...);
116 RunShapeInferenceTest<LayerT>(layer, dimensionSizeLists);
123 {
"InferAndValidate",
true }
129 auto inputLayer = network->AddInputLayer(1,
"inputLayer");
130 inputLayer->GetOutputSlot(0).SetTensorInfo(tensorInfo);
134 auto activationLayer = network->AddActivationLayer(descriptor,
"activation");
136 inputLayer->GetOutputSlot(0).Connect(activationLayer->GetInputSlot(0));
139 BOOST_CHECK_NO_THROW(activationLayer->GetOutputSlot(0).IsTensorInfoSet());
141 BOOST_CHECK(activationLayer->GetOutputSlot(0).GetTensorInfo() == tensorInfo);
144 ShapeInferenceMethodOption =
BackendOptions(
"ShapeInferenceMethod",
146 {
"InferAndValidate",
false }
151 inputLayer = network->AddInputLayer(1,
"inputLayer");
152 inputLayer->GetOutputSlot(0).SetTensorInfo(tensorInfo);
154 activationLayer = network->AddActivationLayer(descriptor,
"activation");
156 inputLayer->GetOutputSlot(0).Connect(activationLayer->GetInputSlot(0));
159 BOOST_CHECK_NO_THROW(activationLayer->GetOutputSlot(0).IsTensorInfoSet());
163 inputLayer = network->AddInputLayer(1,
"inputLayer");
164 inputLayer->GetOutputSlot(0).SetTensorInfo(tensorInfo);
166 activationLayer = network->AddActivationLayer(descriptor,
"activation");
168 inputLayer->GetOutputSlot(0).Connect(activationLayer->GetInputSlot(0));
171 BOOST_CHECK_NO_THROW(activationLayer->GetOutputSlot(0).IsTensorInfoSet());
178 CreateGraphAndRunTest<ActivationLayer>({{ 5, 7, 6, 2 }}, {{ 5, 7, 6, 2 }}, descriptor,
"activation");
183 CreateGraphAndRunTest<AdditionLayer>({{ 5, 7, 6, 2 }, { 5, 7, 6, 2 }}, {{ 5, 7, 6, 2 }},
"add");
192 CreateGraphAndRunTest<ArgMinMaxLayer>({{ 1, 3, 2, 4 }}, {{ 1, 2, 4 }}, descriptor,
"argMinMax");
198 CreateGraphAndRunTest<BatchNormalizationLayer>({{ 1, 2, 3, 2 }}, {{ 1, 2, 3, 2 }}, descriptor,
"batchNorm");
205 std::vector<unsigned int> blockShape {2, 2};
206 std::vector<std::pair<unsigned int, unsigned int>> crops = {{0, 0}, {0, 0}};
212 CreateGraphAndRunTest<BatchToSpaceNdLayer>({{ 4, 2, 2, 1 }}, {{ 1, 4, 4, 1 }}, descriptor,
"batchtospacend");
219 CreateGraphAndRunTest<ComparisonLayer>({{ 5, 7, 6, 2 }, { 5, 7, 6, 2 }},
229 descriptor.SetViewOriginCoord(0, 0, 0);
230 descriptor.SetViewOriginCoord(1, 0, 1);
232 CreateGraphAndRunTest<ConcatLayer>({{ 1, 2, 1 }, { 1, 2, 1 }}, {{ 2, 2, 1 }}, descriptor,
"concat");
239 auto layer = BuildGraph<ConstantLayer>(&graph, {},
"constant");
241 const float Datum = 0.0f;
243 layer->m_LayerOutput = std::make_unique<ScopedCpuTensorHandle>(output0);
245 layer->GetOutputSlot(0).SetTensorInfo({{1, 1, 3, 3}, DataType::Float32});
247 layer->ValidateTensorShapesFromInputs();
249 BOOST_CHECK(layer->GetOutputSlot(0).GetTensorInfo().GetShape() == outputShape);
254 CreateGraphAndRunTest<ConvertBf16ToFp32Layer>({{ 5, 7, 6, 2 }}, {{ 5, 7, 6, 2 }},
"floor");
260 CreateGraphAndRunTest<ConvertFp32ToBf16Layer>({{ 5, 7, 6, 2 }}, {{ 5, 7, 6, 2 }},
"floor");
265 CreateGraphAndRunTest<ConvertFp16ToFp32Layer>({{ 5, 7, 6, 2 }}, {{ 5, 7, 6, 2 }},
"floor");
270 CreateGraphAndRunTest<ConvertFp32ToFp16Layer>({{ 5, 7, 6, 2 }}, {{ 5, 7, 6, 2 }},
"floor");
290 auto layer = BuildGraph<Convolution2dLayer>(&graph,
295 const float Datum = 0.0f;
296 ConstTensor weights({{1, 1, 3, 3}, DataType::Float32}, &Datum);
297 layer->m_Weight = std::make_unique<ScopedCpuTensorHandle>(weights);
299 RunShapeInferenceTest<Convolution2dLayer>(layer, {{ 1, 1, 4, 4 }});
305 CreateGraphAndRunTest<DebugLayer>({{ 5, 7, 6, 2 }}, {{ 5, 7, 6, 2 }},
"debug");
315 CreateGraphAndRunTest<DepthToSpaceLayer>({{ 1, 1, 1, 8}}, {{ 1, 2, 2, 2 }}, descriptor,
"depthtospace");
335 auto layer = BuildGraph<DepthwiseConvolution2dLayer>(&graph,
340 const float Datum = 0.0f;
341 ConstTensor weights({{ 2, 5, 3, 2 }, DataType::Float32}, &Datum);
342 layer->m_Weight = std::make_unique<ScopedCpuTensorHandle>(weights);
344 RunShapeInferenceTest<DepthwiseConvolution2dLayer>(layer, {{ 8, 18, 1, 2 }});
350 CreateGraphAndRunTest<DequantizeLayer>({{ 5, 7, 6, 2 }}, {{ 5, 7, 6, 2 }},
"dequantize");
372 const float Datum = 0.0f;
373 ConstTensor anchorsTensor({{1, 1, 3, 3}, DataType::Float32}, &Datum);
377 auto layer = BuildGraph<DetectionPostProcessLayer>(&graph,
378 {detectionBoxesInfo, detectionScoresInfo},
380 "detectionpostprocess");
382 layer->m_Anchors = std::make_unique<ScopedCpuTensorHandle>(anchorsTensor);
384 RunShapeInferenceTest<DetectionPostProcessLayer>(layer, {{ 1, 3, 4 }, { 1, 3 }, { 1, 3 }, { 1 }});
390 descriptor.
m_Max = 1;
391 descriptor.
m_Min = 1;
392 CreateGraphAndRunTest<FakeQuantizationLayer>({{ 5, 7, 6, 2 }}, {{ 5, 7, 6, 2 }}, descriptor,
"fakequantization");
398 CreateGraphAndRunTest<FloorLayer>({{ 5, 7, 6, 2 }}, {{ 5, 7, 6, 2 }},
"floor");
405 const unsigned int inputWidth = 3u;
406 const unsigned int inputHeight = 2u;
407 const unsigned int inputChannels = 1u;
408 const unsigned int outputChannels = 2u;
410 auto layer = BuildGraph<FullyConnectedLayer>(&graph,
411 {{1, inputChannels, inputHeight, inputWidth}},
416 const float Datum = 0.0f;
417 ConstTensor weights({{inputChannels, outputChannels}, DataType::Float32}, &Datum);
418 layer->m_Weight = std::make_unique<ScopedCpuTensorHandle>(weights);
420 RunShapeInferenceTest<FullyConnectedLayer>(layer, {{ 1, outputChannels }});
425 CreateGraphAndRunTest<GatherLayer>({{ 7, 6, 2}, {2,3}}, {{ 2, 3, 6, 2 }},
GatherDescriptor(),
"gather");
432 CreateGraphAndRunTest<InstanceNormalizationLayer>({{ 5, 7, 6, 2 }}, {{ 5, 7, 6, 2 }},
441 CreateGraphAndRunTest<L2NormalizationLayer>({{ 5, 7, 6, 2 }}, {{ 5, 7, 6, 2 }},
450 CreateGraphAndRunTest<LogSoftmaxLayer>({{ 5, 7, 6, 2 }}, {{ 5, 7, 6, 2 }},
LogSoftmaxDescriptor(),
"logsoftmax");
467 auto layer = BuildGraph<LstmLayer>(&graph, {inputShape, inputCellState, inputCellState}, descriptor,
"lstm");
470 ConstTensor constTensor({{ 2, 5, 3, 2 }, DataType::Float32}, &Datum);
472 layer->m_BasicParameters.m_InputToCellWeights = std::make_unique<ScopedCpuTensorHandle>(constTensor);
473 layer->m_BasicParameters.m_InputToForgetWeights = std::make_unique<ScopedCpuTensorHandle>(constTensor);
474 layer->m_BasicParameters.m_CellBias = std::make_unique<ScopedCpuTensorHandle>(constTensor);
475 layer->m_BasicParameters.m_ForgetGateBias = std::make_unique<ScopedCpuTensorHandle>(constTensor);
476 layer->m_CifgParameters.m_InputGateBias = std::make_unique<ScopedCpuTensorHandle>(constTensor);
477 layer->m_BasicParameters.m_OutputGateBias = std::make_unique<ScopedCpuTensorHandle>(constTensor);
478 layer->m_BasicParameters.m_RecurrentToForgetWeights = std::make_unique<ScopedCpuTensorHandle>(constTensor);
479 layer->m_BasicParameters.m_RecurrentToCellWeights = std::make_unique<ScopedCpuTensorHandle>(constTensor);
480 layer->m_BasicParameters.m_InputToOutputWeights = std::make_unique<ScopedCpuTensorHandle>(constTensor);
481 layer->m_BasicParameters.m_RecurrentToOutputWeights = std::make_unique<ScopedCpuTensorHandle>(constTensor);
482 layer->m_CifgParameters.m_RecurrentToInputWeights = std::make_unique<ScopedCpuTensorHandle>(constTensor);
483 layer->m_CifgParameters.m_InputToInputWeights = std::make_unique<ScopedCpuTensorHandle>(constTensor);
485 RunShapeInferenceTest<LstmLayer>(layer, {{2, 80}, {2, 20}, {2, 20}, {2, 20}});
493 CreateGraphAndRunTest<MeanLayer>({{ 5, 7, 6, 2 }}, {{ 7, 6, 2 }}, descriptor,
"mean");
498 CreateGraphAndRunTest<MemCopyLayer>({{ 5, 7, 6, 2 }}, {{ 5, 7, 6, 2 }},
"memcopy");
503 CreateGraphAndRunTest<MemImportLayer>({{ 5, 7, 6, 2 }}, {{ 5, 7, 6, 2 }},
"memomport");
509 CreateGraphAndRunTest<MergeLayer>({ { 5, 7, 6, 2 }, { 5, 7, 6, 2 } }, {{ 5, 7, 6, 2 }},
"merge");
516 CreateGraphAndRunTest<NormalizationLayer>({{ 5, 7, 6, 2 }}, {{ 5, 7, 6, 2 }},
NormalizationDescriptor(),
"l2norm");
524 CreateGraphAndRunTest<PermuteLayer>({{ 1, 2, 2, 3 }}, {{ 1, 3, 2, 2 }}, descriptor,
"permute");
539 CreateGraphAndRunTest<Pooling2dLayer>({{ 1, 2, 8, 13 }}, {{ 1, 2, 2, 8 }}, descriptor,
"pooling2d");
555 auto layer = BuildGraph<QLstmLayer>(&graph, {inputShape, inputCellState, inputCellState}, descriptor,
"qlstm");
558 ConstTensor constTensor({{ 2, 5, 3, 2 }, DataType::Float32}, &Datum);
560 layer->m_BasicParameters.m_InputToCellWeights = std::make_unique<ScopedCpuTensorHandle>(constTensor);
561 layer->m_BasicParameters.m_InputToForgetWeights = std::make_unique<ScopedCpuTensorHandle>(constTensor);
562 layer->m_BasicParameters.m_CellBias = std::make_unique<ScopedCpuTensorHandle>(constTensor);
563 layer->m_BasicParameters.m_ForgetGateBias = std::make_unique<ScopedCpuTensorHandle>(constTensor);
564 layer->m_CifgParameters.m_InputGateBias = std::make_unique<ScopedCpuTensorHandle>(constTensor);
565 layer->m_BasicParameters.m_OutputGateBias = std::make_unique<ScopedCpuTensorHandle>(constTensor);
566 layer->m_BasicParameters.m_RecurrentToForgetWeights = std::make_unique<ScopedCpuTensorHandle>(constTensor);
567 layer->m_BasicParameters.m_RecurrentToCellWeights = std::make_unique<ScopedCpuTensorHandle>(constTensor);
568 layer->m_BasicParameters.m_InputToOutputWeights = std::make_unique<ScopedCpuTensorHandle>(constTensor);
569 layer->m_BasicParameters.m_RecurrentToOutputWeights = std::make_unique<ScopedCpuTensorHandle>(constTensor);
570 layer->m_CifgParameters.m_RecurrentToInputWeights = std::make_unique<ScopedCpuTensorHandle>(constTensor);
571 layer->m_CifgParameters.m_InputToInputWeights = std::make_unique<ScopedCpuTensorHandle>(constTensor);
573 RunShapeInferenceTest<QLstmLayer>(layer, {{2, 20}, {2, 20}, {2, 20}});
583 auto layer = BuildGraph<QuantizedLstmLayer>(&graph, {inputShape, inputCellState, inputCellState},
"quatizedlstm");
586 ConstTensor constTensor({{ 2, 5, 3, 2 }, DataType::Float32}, &Datum);
588 layer->m_QuantizedLstmParameters.m_InputToCellWeights = std::make_unique<ScopedCpuTensorHandle>(constTensor);
589 layer->m_QuantizedLstmParameters.m_InputToForgetWeights = std::make_unique<ScopedCpuTensorHandle>(constTensor);
590 layer->m_QuantizedLstmParameters.m_CellBias = std::make_unique<ScopedCpuTensorHandle>(constTensor);
591 layer->m_QuantizedLstmParameters.m_ForgetGateBias = std::make_unique<ScopedCpuTensorHandle>(constTensor);
592 layer->m_QuantizedLstmParameters.m_InputGateBias = std::make_unique<ScopedCpuTensorHandle>(constTensor);
593 layer->m_QuantizedLstmParameters.m_OutputGateBias = std::make_unique<ScopedCpuTensorHandle>(constTensor);
594 layer->m_QuantizedLstmParameters.m_RecurrentToForgetWeights = std::make_unique<ScopedCpuTensorHandle>(constTensor);
595 layer->m_QuantizedLstmParameters.m_RecurrentToCellWeights = std::make_unique<ScopedCpuTensorHandle>(constTensor);
596 layer->m_QuantizedLstmParameters.m_InputToOutputWeights = std::make_unique<ScopedCpuTensorHandle>(constTensor);
597 layer->m_QuantizedLstmParameters.m_RecurrentToOutputWeights = std::make_unique<ScopedCpuTensorHandle>(constTensor);
598 layer->m_QuantizedLstmParameters.m_RecurrentToInputWeights = std::make_unique<ScopedCpuTensorHandle>(constTensor);
599 layer->m_QuantizedLstmParameters.m_InputToInputWeights = std::make_unique<ScopedCpuTensorHandle>(constTensor);
601 RunShapeInferenceTest<QuantizedLstmLayer>(layer, {{2, 20}, {2, 20}, {2, 20}});
607 CreateGraphAndRunTest<QuantizeLayer>({{ 5, 7, 6, 2 }}, {{ 5, 7, 6, 2 }},
"mean");
616 auto layer = BuildGraph<RankLayer>(&graph, {{ 1, 1, 1, 1 }},
"rank");
625 layer->ValidateTensorShapesFromInputs();
627 BOOST_CHECK(layer->GetOutputSlot(0).GetTensorInfo().GetShape() == expectedOutputs);
631 layer->ValidateTensorShapesFromInputs();
633 BOOST_CHECK(layer->GetOutputSlot(0).GetTensorInfo().GetShape() == expectedOutputs);
642 CreateGraphAndRunTest<ReshapeLayer>({{ 2, 2, 2, 2 }}, {{ 1, 1, 1, 8 }}, descriptor,
"reshape");
652 CreateGraphAndRunTest<ResizeLayer>({{ 1, 7, 6, 2 }}, {{ 1, 7, 6, 2 }}, descriptor,
"resize");
658 descriptor.
m_Begin = { 1, 0, 1, 2 };
659 descriptor.
m_Size = { 2, 1, 2, 3 };
661 CreateGraphAndRunTest<SliceLayer>({{ 3, 2, 3, 5 }}, {{ 2, 1, 2, 3 }}, descriptor,
"mean");
668 std::vector<unsigned int> blockShape {2, 2};
669 std::vector<std::pair<unsigned int, unsigned int>> padlist = {{0, 0}, {0, 0}};
675 CreateGraphAndRunTest<SpaceToBatchNdLayer>({{ 1, 4, 4, 1 }}, {{ 4, 2, 2, 1 }}, descriptor,
"spacetobatchnd");
685 CreateGraphAndRunTest<SpaceToDepthLayer>({{ 1, 2, 2, 2 }}, {{ 1, 1, 1, 8}}, descriptor,
"spacetodepth");
692 descriptor.SetViewSize(0, 0, 1);
693 descriptor.SetViewSize(0, 1, 2);
694 descriptor.SetViewSize(0, 2, 2);
696 descriptor.SetViewSize(1, 0, 1);
697 descriptor.SetViewSize(1, 1, 2);
698 descriptor.SetViewSize(1, 2, 2);
700 CreateGraphAndRunTest<SplitterLayer>({{ 2, 2, 2 }}, {{ 1, 2, 2 }, { 1, 2, 2 }}, descriptor,
"splitter");
711 CreateGraphAndRunTest<StackLayer>({{ 3, 2, 3 }, { 3, 2, 3 }}, {{ 2, 3, 2, 3 }}, descriptor,
"stack");
718 descriptor.
m_Begin = {0, 0, 0, 0};
719 descriptor.
m_End = {3, 2, 3, 1};
722 CreateGraphAndRunTest<StridedSliceLayer>({{ 3, 2, 3, 1 }}, {{ 2, 1, 2, 1 }}, descriptor,
"stridedslice");
727 CreateGraphAndRunTest<SwitchLayer>({{ 3, 2, 3, 1 }, { 3, 2, 3, 1 }}, {{ 3, 2, 3, 1 }, { 3, 2, 3, 1 }},
"switch");
734 descriptor.
m_Begin = {0, 0, 0, 0};
735 descriptor.
m_End = {3, 2, 3, 1};
738 CreateGraphAndRunTest<StridedSliceLayer>({{ 3, 2, 3, 1 }}, {{ 2, 1, 2, 1 }}, descriptor,
"t");
746 CreateGraphAndRunTest<TransposeLayer>({{ 1, 2, 2, 3 }}, {{ 1, 3, 2, 2 }}, descriptor,
"stridedslice");
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
uint32_t m_PadBottom
Padding bottom value in the height dimension.
bool m_ProjectionEnabled
Enable/disable the projection layer.
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.
LayerTestResult< float, 3 > ConcatTest(IWorkloadFactory &workloadFactory, const IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
uint32_t m_PadBottom
Padding bottom value in the height dimension.
bool m_BiasEnabled
Enable/disable bias.
LayerTestResult< T, 2 > FullyConnectedTest(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory, bool biasEnabled)
LayerTestResult< float, 2 > FakeQuantizationTest(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
uint32_t m_PadBottom
Padding bottom value in the height dimension.
uint32_t m_PadLeft
Padding left value in the width dimension.
A ReshapeDescriptor for the ReshapeLayer.
std::vector< int > m_Begin
Begin values for the input that will be sliced.
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.
LayerT * AddLayer(Args &&... args)
Adds a new layer, of type LayerType, to the graph constructed with the arguments passed.
float m_Min
Minimum value.
uint32_t m_PoolWidth
Pooling width value.
bool m_PeepholeEnabled
Enable/disable peephole.
A Convolution2dDescriptor for the Convolution2dLayer.
uint32_t m_PadLeft
Padding left value in the width dimension.
LayerTestResult< int8_t, 2 > QLstmTest(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
std::vector< unsigned int > m_Size
Size of the slice in each dimension.
The padding fields don't count and are ignored.
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).
uint32_t m_PadTop
Padding top value in the height dimension.
uint32_t m_PadRight
Padding right value in the width dimension.
Copyright (c) 2021 ARM Limited and Contributors.
LayerTestResult< float, 4 > AdditionTest(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
uint32_t m_DilationY
Dilation along y axis.
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.
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.
A ResizeDescriptor for the ResizeLayer.
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).
TensorShape m_TargetShape
Target shape value.
uint32_t m_PoolHeight
Pooling height value.
uint32_t m_PadTop
Padding top value in the height dimension.
uint32_t m_MaxDetections
Maximum numbers of detections.
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.
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.
std::vector< unsigned int > m_Begin
Beginning indices of the slice in each dimension.
std::vector< unsigned int > m_BlockShape
Block shape values.
A L2NormalizationDescriptor for the L2NormalizationLayer.
An ArgMinMaxDescriptor for ArgMinMaxLayer.
An OriginsDescriptor for the ConcatLayer.
A FullyConnectedDescriptor for the FullyConnectedLayer.
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
A FakeQuantizationDescriptor for the FakeQuantizationLayer.
Validate all output shapes.
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.
LayerTestResult< uint8_t, 2 > QuantizedLstmTest(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
A QLstmDescriptor for the QLstmLayer.
bool m_UseRegularNms
Use Regular NMS.
BOOST_AUTO_TEST_CASE(CheckConvolution2dLayer)
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.
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.
LayerTestResult< float, 4 > ConvertBf16ToFp32Test(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
unsigned int m_BlockSize
Scalar specifying the input block size. It must be >= 1.
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.
Struct for the users to pass backend specific options.
uint32_t m_DilationX
Dilation along x axis.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
BOOST_AUTO_TEST_SUITE_END()
bool m_CifgEnabled
Enable/disable cifg (coupled input & forget gate).
SoftmaxDescriptor LogSoftmaxDescriptor
A LogSoftmaxDescriptor for the LogSoftmaxLayer.
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.
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).
A MeanDescriptor for the MeanLayer.
Infer missing output shapes and validate all output shapes.
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)
float m_ScaleY
Center size encoding scale y.
float m_NmsScoreThreshold
NMS score threshold.
std::unique_ptr< INetwork, void(*)(INetwork *network)> INetworkPtr
A Pooling2dDescriptor for the Pooling2dLayer.
LayerTestResult< float, 4 > AbsTest(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
A NormalizationDescriptor for the NormalizationLayer.
An InstanceNormalizationDescriptor for InstanceNormalizationLayer.
static INetworkPtr Create(NetworkOptions networkOptions={})
LayerTestResult< int32_t, 1 > RankTest(armnn::TensorInfo inputTensorInfo, boost::multi_array< T, n > input, armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
float m_Max
Maximum value.
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.
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 BatchNormalizationDescriptor for the BatchNormalizationLayer.
uint32_t m_PadLeft
Padding left value in the width dimension.
A PermuteDescriptor for the PermuteLayer.
uint32_t m_PadRight
Padding right value in the width dimension.