ArmNN
 21.08
InferOutputTests.hpp File Reference
#include "TestUtils.hpp"
#include <Graph.hpp>
#include <layers/ArgMinMaxLayer.hpp>
#include <layers/BatchToSpaceNdLayer.hpp>
#include <layers/SpaceToDepthLayer.hpp>
#include <layers/PreluLayer.hpp>
#include <layers/StackLayer.hpp>
#include <doctest/doctest.h>

Go to the source code of this file.

Functions

void ArgMinMaxInferOutputShapeImpl (const armnn::ArgMinMaxDescriptor descriptor, const std::vector< armnn::TensorShape > &inputShapes, std::vector< armnn::TensorShape > &outputShapes)
 
void ArgMinMaxInferOutputShape4dTest ()
 
void ArgMinMaxInferOutputShape3dTest ()
 
void ArgMinMaxInferOutputShape2dTest ()
 
void ArgMinMaxInferOutputShape1dTest ()
 
void BatchToSpaceInferOutputShapeTest ()
 
void SpaceToDepthInferOutputShapeTest ()
 
void PreluInferOutputShapeImpl (const std::vector< armnn::TensorShape > &inputShapes, std::vector< armnn::TensorShape > &outputShapes)
 
void PreluInferOutputShapeSameDimsTest ()
 
void PreluInferOutputShapeInputBiggerTest ()
 
void PreluInferOutputShapeAlphaBiggerTest ()
 
void PreluInferOutputShapeNoMatchTest ()
 
void CreatePreluLayerHelper (armnn::Graph &graph, const armnn::TensorShape &inputShape, const armnn::TensorShape &alphaShape, const armnn::TensorShape &outputShape)
 
void PreluValidateTensorShapesFromInputsMatchTest ()
 
void PreluValidateTensorShapesFromInputsNoMatchTest ()
 
void StackInferOutputShapeImpl (const armnn::StackDescriptor descriptor, const std::vector< armnn::TensorShape > &inputShapes, std::vector< armnn::TensorShape > &outputShapes)
 
void StackInferOutputShapeFromInputsMatchTest ()
 
void StackInferOutputShapeFromInputsNoMatchTest ()
 
void CreateStackLayerHelper (armnn::Graph &graph, const armnn::StackDescriptor &descriptor, const std::vector< armnn::TensorShape > &inputShapes, const armnn::TensorShape &outputShape)
 
void StackValidateTensorShapesFromInputsMatchTest ()
 
void StackValidateTensorShapesFromInputsNoMatchTest ()
 
void Convolution2dInferOutputShapeTest ()
 
void TransposeConvolution2dInferOutputShapeTest ()
 
void DepthwiseConvolution2dInferOutputShapeTest ()
 
void QLstmInferOutputShapeImpl (const armnn::QLstmDescriptor descriptor, const std::vector< armnn::TensorShape > &inputShapes, std::vector< armnn::TensorShape > &outputShapes)
 
void QLstmInferOutputShapeTest ()
 
void QuantizedLstmInferOutputShapeImpl (const std::vector< armnn::TensorShape > &inputShapes, std::vector< armnn::TensorShape > &outputShapes)
 
void QuantizedLstmInferOutputShapeTest ()
 

Function Documentation

◆ ArgMinMaxInferOutputShape1dTest()

void ArgMinMaxInferOutputShape1dTest ( )

Definition at line 85 of file InferOutputTests.hpp.

References ArgMinMaxInferOutputShapeImpl(), and ArgMinMaxDescriptor::m_Axis.

Referenced by TEST_SUITE().

86 {
87  armnn::Graph graph;
88  armnn::ArgMinMaxDescriptor descriptor;
89  descriptor.m_Axis = 0;
90 
91  const std::vector<armnn::TensorShape> inputShapes
92  {
93  { 5 }
94  };
95 
96  std::vector<armnn::TensorShape> outputShapes;
97  CHECK_NOTHROW(ArgMinMaxInferOutputShapeImpl(descriptor, inputShapes, outputShapes));
98 
99  armnn::TensorShape expectedOutputShape( { 1 } );
100  CHECK(outputShapes.size() == 1);
101  CHECK(outputShapes[0] == expectedOutputShape);
102 }
An ArgMinMaxDescriptor for ArgMinMaxLayer.
Definition: Descriptors.hpp:56
void ArgMinMaxInferOutputShapeImpl(const armnn::ArgMinMaxDescriptor descriptor, const std::vector< armnn::TensorShape > &inputShapes, std::vector< armnn::TensorShape > &outputShapes)
int m_Axis
Axis to reduce across the input tensor.
Definition: Descriptors.hpp:72

◆ ArgMinMaxInferOutputShape2dTest()

void ArgMinMaxInferOutputShape2dTest ( )

Definition at line 66 of file InferOutputTests.hpp.

References ArgMinMaxInferOutputShapeImpl(), and ArgMinMaxDescriptor::m_Axis.

Referenced by TEST_SUITE().

67 {
68  armnn::Graph graph;
69  armnn::ArgMinMaxDescriptor descriptor;
70  descriptor.m_Axis = 1;
71 
72  const std::vector<armnn::TensorShape> inputShapes
73  {
74  { 3, 2 }
75  };
76 
77  std::vector<armnn::TensorShape> outputShapes;
78  CHECK_NOTHROW(ArgMinMaxInferOutputShapeImpl(descriptor, inputShapes, outputShapes));
79 
80  armnn::TensorShape expectedOutputShape( { 3 } );
81  CHECK(outputShapes.size() == 1);
82  CHECK(outputShapes[0] == expectedOutputShape);
83 }
An ArgMinMaxDescriptor for ArgMinMaxLayer.
Definition: Descriptors.hpp:56
void ArgMinMaxInferOutputShapeImpl(const armnn::ArgMinMaxDescriptor descriptor, const std::vector< armnn::TensorShape > &inputShapes, std::vector< armnn::TensorShape > &outputShapes)
int m_Axis
Axis to reduce across the input tensor.
Definition: Descriptors.hpp:72

◆ ArgMinMaxInferOutputShape3dTest()

void ArgMinMaxInferOutputShape3dTest ( )

Definition at line 47 of file InferOutputTests.hpp.

References ArgMinMaxInferOutputShapeImpl(), and ArgMinMaxDescriptor::m_Axis.

Referenced by TEST_SUITE().

48 {
49  armnn::Graph graph;
50  armnn::ArgMinMaxDescriptor descriptor;
51  descriptor.m_Axis = 0;
52 
53  const std::vector<armnn::TensorShape> inputShapes
54  {
55  { 1, 3, 2 }
56  };
57 
58  std::vector<armnn::TensorShape> outputShapes;
59  CHECK_NOTHROW(ArgMinMaxInferOutputShapeImpl(descriptor, inputShapes, outputShapes));
60 
61  armnn::TensorShape expectedOutputShape( { 3, 2 } );
62  CHECK(outputShapes.size() == 1);
63  CHECK(outputShapes[0] == expectedOutputShape);
64 }
An ArgMinMaxDescriptor for ArgMinMaxLayer.
Definition: Descriptors.hpp:56
void ArgMinMaxInferOutputShapeImpl(const armnn::ArgMinMaxDescriptor descriptor, const std::vector< armnn::TensorShape > &inputShapes, std::vector< armnn::TensorShape > &outputShapes)
int m_Axis
Axis to reduce across the input tensor.
Definition: Descriptors.hpp:72

◆ ArgMinMaxInferOutputShape4dTest()

void ArgMinMaxInferOutputShape4dTest ( )

Definition at line 28 of file InferOutputTests.hpp.

References ArgMinMaxInferOutputShapeImpl(), and ArgMinMaxDescriptor::m_Axis.

Referenced by TEST_SUITE().

29 {
30  armnn::Graph graph;
31  armnn::ArgMinMaxDescriptor descriptor;
32  descriptor.m_Axis = 2;
33 
34  const std::vector<armnn::TensorShape> inputShapes
35  {
36  { 1, 3, 2, 4 }
37  };
38 
39  std::vector<armnn::TensorShape> outputShapes;
40  CHECK_NOTHROW(ArgMinMaxInferOutputShapeImpl(descriptor, inputShapes, outputShapes));
41 
42  armnn::TensorShape expectedOutputShape( { 1, 3, 4 } );
43  CHECK(outputShapes.size() == 1);
44  CHECK(outputShapes[0] == expectedOutputShape);
45 }
An ArgMinMaxDescriptor for ArgMinMaxLayer.
Definition: Descriptors.hpp:56
void ArgMinMaxInferOutputShapeImpl(const armnn::ArgMinMaxDescriptor descriptor, const std::vector< armnn::TensorShape > &inputShapes, std::vector< armnn::TensorShape > &outputShapes)
int m_Axis
Axis to reduce across the input tensor.
Definition: Descriptors.hpp:72

◆ ArgMinMaxInferOutputShapeImpl()

void ArgMinMaxInferOutputShapeImpl ( const armnn::ArgMinMaxDescriptor  descriptor,
const std::vector< armnn::TensorShape > &  inputShapes,
std::vector< armnn::TensorShape > &  outputShapes 
)

Definition at line 19 of file InferOutputTests.hpp.

References Graph::AddLayer(), and ArgMinMaxLayer::InferOutputShapes().

Referenced by ArgMinMaxInferOutputShape1dTest(), ArgMinMaxInferOutputShape2dTest(), ArgMinMaxInferOutputShape3dTest(), and ArgMinMaxInferOutputShape4dTest().

22 {
23  armnn::Graph graph;
24  auto argMinMaxLayer = graph.AddLayer<armnn::ArgMinMaxLayer>(descriptor, "argMinMax");
25  outputShapes = argMinMaxLayer->InferOutputShapes(inputShapes);
26 }
LayerT * AddLayer(Args &&... args)
Adds a new layer, of type LayerType, to the graph constructed with the arguments passed.
Definition: Graph.hpp:402
This layer represents a ArgMinMax operation.
std::vector< TensorShape > InferOutputShapes(const std::vector< TensorShape > &inputShapes) const override
Infers the output shape from a given input shape and axis parameter.

◆ BatchToSpaceInferOutputShapeTest()

void BatchToSpaceInferOutputShapeTest ( )

Definition at line 104 of file InferOutputTests.hpp.

References Graph::AddLayer(), BatchToSpaceNdLayer::InferOutputShapes(), BatchToSpaceNdDescriptor::m_BlockShape, BatchToSpaceNdDescriptor::m_Crops, BatchToSpaceNdDescriptor::m_DataLayout, and armnn::NHWC.

Referenced by TEST_SUITE().

105 {
106  armnn::Graph graph;
107 
109  descriptor.m_BlockShape = {2, 2};
110  descriptor.m_Crops = {{0, 0}, {2, 0}};
112 
113  armnn::BatchToSpaceNdLayer* const batchToSpaceLayer =
114  graph.AddLayer<armnn::BatchToSpaceNdLayer>(descriptor, "batchToSpace");
115 
116  std::vector<armnn::TensorShape> shapes;
117  const std::vector<unsigned int> theDimSizes = {8, 1, 3, 1};
118  armnn::TensorShape shape(4, theDimSizes.data());
119  shapes.push_back(shape);
120 
121  const std::vector<unsigned int> expectedDimSizes = {2, 2, 4, 1};
122  armnn::TensorShape expectedShape(4, expectedDimSizes.data());
123 
124  CHECK(expectedShape == batchToSpaceLayer->InferOutputShapes(shapes).at(0));
125 }
std::vector< TensorShape > InferOutputShapes(const std::vector< TensorShape > &inputShapes) const override
By default returns inputShapes if the number of inputs are equal to number of outputs, otherwise infers the output shapes from given input shapes and layer properties.
LayerT * AddLayer(Args &&... args)
Adds a new layer, of type LayerType, to the graph constructed with the arguments passed.
Definition: Graph.hpp:402
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
std::vector< unsigned int > m_BlockShape
Block shape values.
This layer represents a BatchToSpaceNd operation.
std::vector< std::pair< unsigned int, unsigned int > > m_Crops
The values to crop from the input dimension.

◆ Convolution2dInferOutputShapeTest()

void Convolution2dInferOutputShapeTest ( )

Definition at line 434 of file InferOutputTests.hpp.

References Graph::AddLayer(), Convolution2dLayer::InferOutputShapes(), Convolution2dDescriptor::m_DataLayout, Convolution2dDescriptor::m_DilationX, Convolution2dDescriptor::m_DilationY, Convolution2dDescriptor::m_PadBottom, Convolution2dDescriptor::m_PadLeft, Convolution2dDescriptor::m_PadRight, Convolution2dDescriptor::m_PadTop, Convolution2dDescriptor::m_StrideX, Convolution2dDescriptor::m_StrideY, and armnn::NCHW.

Referenced by TEST_SUITE().

435 {
436  armnn::Graph graph;
437 
439  descriptor.m_DilationX = 2;
440  descriptor.m_DilationY = 2;
441  descriptor.m_PadTop = 1;
442  descriptor.m_PadBottom = 1;
443  descriptor.m_PadLeft = 1;
444  descriptor.m_PadRight = 1;
445  descriptor.m_StrideX = 3;
446  descriptor.m_StrideY = 3;
448 
449  armnn::Convolution2dLayer* const convolution2dLayer =
450  graph.AddLayer<armnn::Convolution2dLayer>(descriptor, "convolution2d");
451 
452  std::vector<armnn::TensorShape> shapes;
453  const std::vector<unsigned int> inputSize = {1, 2, 10, 10};
454  armnn::TensorShape inputShape(4, inputSize.data());
455  shapes.push_back(inputShape);
456 
457  const std::vector<unsigned int> filterSize = { 1, 2, 2, 2};
458  armnn::TensorShape filterShape(4, filterSize.data());
459  shapes.push_back(filterShape);
460 
461  const std::vector<unsigned int> expectedOutputSizes = {1, 1, 4, 4};
462  armnn::TensorShape expectedOutputShape(4, expectedOutputSizes.data());
463 
464  CHECK(expectedOutputShape == convolution2dLayer->InferOutputShapes(shapes).at(0));
465 }
uint32_t m_PadBottom
Padding bottom value in the height dimension.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
LayerT * AddLayer(Args &&... args)
Adds a new layer, of type LayerType, to the graph constructed with the arguments passed.
Definition: Graph.hpp:402
A Convolution2dDescriptor for the Convolution2dLayer.
uint32_t m_PadRight
Padding right value in the width dimension.
uint32_t m_DilationY
Dilation along y axis.
uint32_t m_PadTop
Padding top value in the height dimension.
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
uint32_t m_StrideY
Stride value when proceeding through input for the height dimension.
uint32_t m_DilationX
Dilation along x axis.
This layer represents a convolution 2d operation.
std::vector< TensorShape > InferOutputShapes(const std::vector< TensorShape > &inputShapes) const override
By default returns inputShapes if the number of inputs are equal to number of outputs, otherwise infers the output shapes from given input shapes and layer properties.
uint32_t m_PadLeft
Padding left value in the width dimension.

◆ CreatePreluLayerHelper()

void CreatePreluLayerHelper ( armnn::Graph graph,
const armnn::TensorShape inputShape,
const armnn::TensorShape alphaShape,
const armnn::TensorShape outputShape 
)

Definition at line 237 of file InferOutputTests.hpp.

References Graph::AddLayer(), Connect(), and armnn::Float32.

Referenced by PreluValidateTensorShapesFromInputsMatchTest(), and PreluValidateTensorShapesFromInputsNoMatchTest().

241 {
242  // Creates the PReLU layer
243  armnn::Layer* const preluLayer = graph.AddLayer<armnn::PreluLayer>("prelu");
244 
245  // Creates extra layers
246  armnn::Layer* const input = graph.AddLayer<armnn::InputLayer> (0, "input");
247  armnn::Layer* const alpha = graph.AddLayer<armnn::InputLayer> (1, "alpha");
248  armnn::Layer* const output = graph.AddLayer<armnn::OutputLayer>(0, "output");
249 
250  // Connects up
251  armnn::TensorInfo inputTensorInfo (inputShape, armnn::DataType::Float32);
252  armnn::TensorInfo alphaTensorInfo (alphaShape, armnn::DataType::Float32);
253  armnn::TensorInfo outputTensorInfo(outputShape, armnn::DataType::Float32);
254  Connect(input, preluLayer, inputTensorInfo, 0, 0);
255  Connect(alpha, preluLayer, alphaTensorInfo, 0, 1);
256  Connect(preluLayer, output, outputTensorInfo, 0, 0);
257 }
LayerT * AddLayer(Args &&... args)
Adds a new layer, of type LayerType, to the graph constructed with the arguments passed.
Definition: Graph.hpp:402
A layer user-provided data can be bound to (e.g. inputs, outputs).
Definition: OutputLayer.hpp:13
A layer user-provided data can be bound to (e.g. inputs, outputs).
Definition: InputLayer.hpp:13
void Connect(armnn::IConnectableLayer *from, armnn::IConnectableLayer *to, const armnn::TensorInfo &tensorInfo, unsigned int fromIndex, unsigned int toIndex)
Definition: TestUtils.cpp:12

◆ CreateStackLayerHelper()

void CreateStackLayerHelper ( armnn::Graph graph,
const armnn::StackDescriptor descriptor,
const std::vector< armnn::TensorShape > &  inputShapes,
const armnn::TensorShape outputShape 
)

Definition at line 351 of file InferOutputTests.hpp.

References Graph::AddLayer(), Connect(), and armnn::Float32.

Referenced by StackValidateTensorShapesFromInputsMatchTest(), and StackValidateTensorShapesFromInputsNoMatchTest().

355 {
356  // Creates the Stack layer
357  armnn::Layer* const stackLayer = graph.AddLayer<armnn::StackLayer>(descriptor, "stack");
358 
359  // Creates extra layers
360  std::vector<armnn::Layer*> inputs;
361  for (unsigned int i=0; i<inputShapes.size(); ++i)
362  {
363  inputs.push_back(graph.AddLayer<armnn::InputLayer>(static_cast<int>(i), "input"));
364  }
365  armnn::Layer* const output = graph.AddLayer<armnn::OutputLayer>(0, "output");
366 
367  // Connects up
368  std::vector<armnn::TensorInfo> inputTensorInfos;
369  for (unsigned int i=0; i<inputs.size(); ++i)
370  {
371  inputTensorInfos.push_back(armnn::TensorInfo(inputShapes[i], armnn::DataType::Float32));
372  }
373  armnn::TensorInfo outputTensorInfo(outputShape, armnn::DataType::Float32);
374 
375  for (unsigned int i=0; i<inputs.size(); ++i)
376  {
377  Connect(inputs[i], stackLayer, inputTensorInfos[i], 0, i);
378  }
379  Connect(stackLayer, output, outputTensorInfo, 0, 0);
380 }
LayerT * AddLayer(Args &&... args)
Adds a new layer, of type LayerType, to the graph constructed with the arguments passed.
Definition: Graph.hpp:402
A layer user-provided data can be bound to (e.g. inputs, outputs).
Definition: OutputLayer.hpp:13
This layer represents a stack operation.
Definition: StackLayer.hpp:13
A layer user-provided data can be bound to (e.g. inputs, outputs).
Definition: InputLayer.hpp:13
void Connect(armnn::IConnectableLayer *from, armnn::IConnectableLayer *to, const armnn::TensorInfo &tensorInfo, unsigned int fromIndex, unsigned int toIndex)
Definition: TestUtils.cpp:12

◆ DepthwiseConvolution2dInferOutputShapeTest()

void DepthwiseConvolution2dInferOutputShapeTest ( )

Definition at line 498 of file InferOutputTests.hpp.

References Graph::AddLayer(), DepthwiseConvolution2dLayer::InferOutputShapes(), DepthwiseConvolution2dDescriptor::m_DataLayout, DepthwiseConvolution2dDescriptor::m_DilationX, DepthwiseConvolution2dDescriptor::m_DilationY, DepthwiseConvolution2dDescriptor::m_PadBottom, DepthwiseConvolution2dDescriptor::m_PadLeft, DepthwiseConvolution2dDescriptor::m_PadRight, DepthwiseConvolution2dDescriptor::m_PadTop, DepthwiseConvolution2dDescriptor::m_StrideX, DepthwiseConvolution2dDescriptor::m_StrideY, and armnn::NCHW.

Referenced by TEST_SUITE().

499 {
500  armnn::Graph graph;
501 
503  descriptor.m_DilationX = 3;
504  descriptor.m_DilationY = 3;
505  descriptor.m_PadTop = 1;
506  descriptor.m_PadBottom = 2;
507  descriptor.m_PadLeft = 1;
508  descriptor.m_PadRight = 2;
509  descriptor.m_StrideX = 2;
510  descriptor.m_StrideY = 2;
512 
513  armnn::DepthwiseConvolution2dLayer* const depthwiseConvolution2dLayer =
514  graph.AddLayer<armnn::DepthwiseConvolution2dLayer>(descriptor, "DepthwiseConvolution2d");
515 
516  std::vector<armnn::TensorShape> shapes;
517  const std::vector<unsigned int> inputSize = {1, 2, 10, 10};
518  armnn::TensorShape inputShape(4, inputSize.data());
519  shapes.push_back(inputShape);
520 
521  const std::vector<unsigned int> filterSize = { 1, 3, 3, 2 };
522  armnn::TensorShape filterShape(4, filterSize.data());
523  shapes.push_back(filterShape);
524 
525  const std::vector<unsigned int> expectedOutputSizes = {1, 2, 4, 4};
526  armnn::TensorShape expectedOutputShape(4, expectedOutputSizes.data());
527 
528  CHECK(expectedOutputShape == depthwiseConvolution2dLayer->InferOutputShapes(shapes).at(0));
529 }
std::vector< TensorShape > InferOutputShapes(const std::vector< TensorShape > &inputShapes) const override
By default returns inputShapes if the number of inputs are equal to number of outputs, otherwise infers the output shapes from given input shapes and layer properties.
uint32_t m_PadBottom
Padding bottom value in the height dimension.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
This layer represents a depthwise convolution 2d operation.
LayerT * AddLayer(Args &&... args)
Adds a new layer, of type LayerType, to the graph constructed with the arguments passed.
Definition: Graph.hpp:402
uint32_t m_PadLeft
Padding left value in the width dimension.
uint32_t m_DilationY
Dilation factor value for height dimension.
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
uint32_t m_DilationX
Dilation factor value for width dimension.
uint32_t m_PadTop
Padding top value in the height dimension.
uint32_t m_StrideY
Stride value when proceeding through input for the height dimension.
A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.
uint32_t m_PadRight
Padding right value in the width dimension.

◆ PreluInferOutputShapeAlphaBiggerTest()

void PreluInferOutputShapeAlphaBiggerTest ( )

Definition at line 197 of file InferOutputTests.hpp.

References PreluInferOutputShapeImpl().

Referenced by TEST_SUITE().

198 {
199  const std::vector<armnn::TensorShape> inputShapes
200  {
201  { 4, 1, 2 }, // Input shape
202  { 5, 4, 3, 1 } // Alpha shape
203  };
204 
205  const std::vector<armnn::TensorShape> expectedOutputShapes
206  {
207  { 5, 4, 3, 2 } // Output shape
208  };
209 
210  std::vector<armnn::TensorShape> outputShapes;
211  CHECK_NOTHROW(PreluInferOutputShapeImpl(inputShapes, outputShapes));
212 
213  CHECK(outputShapes.size() == 1);
214  CHECK(outputShapes[0] == expectedOutputShapes[0]);
215 }
void PreluInferOutputShapeImpl(const std::vector< armnn::TensorShape > &inputShapes, std::vector< armnn::TensorShape > &outputShapes)

◆ PreluInferOutputShapeImpl()

void PreluInferOutputShapeImpl ( const std::vector< armnn::TensorShape > &  inputShapes,
std::vector< armnn::TensorShape > &  outputShapes 
)

Definition at line 149 of file InferOutputTests.hpp.

References Graph::AddLayer(), and PreluLayer::InferOutputShapes().

Referenced by PreluInferOutputShapeAlphaBiggerTest(), PreluInferOutputShapeInputBiggerTest(), PreluInferOutputShapeNoMatchTest(), and PreluInferOutputShapeSameDimsTest().

151 {
152  armnn::Graph graph;
153  armnn::PreluLayer* const preluLayer = graph.AddLayer<armnn::PreluLayer>("prelu");
154  outputShapes = preluLayer->InferOutputShapes(inputShapes);
155 }
LayerT * AddLayer(Args &&... args)
Adds a new layer, of type LayerType, to the graph constructed with the arguments passed.
Definition: Graph.hpp:402
std::vector< TensorShape > InferOutputShapes(const std::vector< TensorShape > &inputShapes) const override
By default returns inputShapes if the number of inputs are equal to number of outputs, otherwise infers the output shapes from given input shapes and layer properties.
Definition: PreluLayer.cpp:38

◆ PreluInferOutputShapeInputBiggerTest()

void PreluInferOutputShapeInputBiggerTest ( )

Definition at line 177 of file InferOutputTests.hpp.

References PreluInferOutputShapeImpl().

Referenced by TEST_SUITE().

178 {
179  const std::vector<armnn::TensorShape> inputShapes
180  {
181  { 4, 1, 4, 8 }, // Input shape
182  { 5, 4, 1 } // Alpha shape
183  };
184 
185  const std::vector<armnn::TensorShape> expectedOutputShapes
186  {
187  { 4, 5, 4, 8 } // Output shape
188  };
189 
190  std::vector<armnn::TensorShape> outputShapes;
191  CHECK_NOTHROW(PreluInferOutputShapeImpl(inputShapes, outputShapes));
192 
193  CHECK(outputShapes.size() == 1);
194  CHECK(outputShapes[0] == expectedOutputShapes[0]);
195 }
void PreluInferOutputShapeImpl(const std::vector< armnn::TensorShape > &inputShapes, std::vector< armnn::TensorShape > &outputShapes)

◆ PreluInferOutputShapeNoMatchTest()

void PreluInferOutputShapeNoMatchTest ( )

Definition at line 217 of file InferOutputTests.hpp.

References PreluInferOutputShapeImpl().

Referenced by TEST_SUITE().

218 {
219  const std::vector<armnn::TensorShape> inputShapes
220  {
221  { 4, 1, 2 }, // Input shape
222  { 5, 4, 3, 1 } // Alpha shape
223  };
224 
225  const std::vector<armnn::TensorShape> expectedOutputShapes
226  {
227  { 5, 7, 3, 2 } // Output shape
228  };
229 
230  std::vector<armnn::TensorShape> outputShapes;
231  CHECK_NOTHROW(PreluInferOutputShapeImpl(inputShapes, outputShapes));
232 
233  CHECK(outputShapes.size() == 1);
234  CHECK(outputShapes[0] != expectedOutputShapes[0]);
235 }
void PreluInferOutputShapeImpl(const std::vector< armnn::TensorShape > &inputShapes, std::vector< armnn::TensorShape > &outputShapes)

◆ PreluInferOutputShapeSameDimsTest()

void PreluInferOutputShapeSameDimsTest ( )

Definition at line 157 of file InferOutputTests.hpp.

References PreluInferOutputShapeImpl().

Referenced by TEST_SUITE().

158 {
159  const std::vector<armnn::TensorShape> inputShapes
160  {
161  { 5, 1, 1, 7 }, // Input shape
162  { 5, 4, 3, 1 } // Alpha shape
163  };
164 
165  const std::vector<armnn::TensorShape> expectedOutputShapes
166  {
167  { 5, 4, 3, 7 } // Output shape
168  };
169 
170  std::vector<armnn::TensorShape> outputShapes;
171  CHECK_NOTHROW(PreluInferOutputShapeImpl(inputShapes, outputShapes));
172 
173  CHECK(outputShapes.size() == 1);
174  CHECK(outputShapes[0] == expectedOutputShapes[0]);
175 }
void PreluInferOutputShapeImpl(const std::vector< armnn::TensorShape > &inputShapes, std::vector< armnn::TensorShape > &outputShapes)

◆ PreluValidateTensorShapesFromInputsMatchTest()

void PreluValidateTensorShapesFromInputsMatchTest ( )

Definition at line 259 of file InferOutputTests.hpp.

References CreatePreluLayerHelper(), and Graph::InferTensorInfos().

Referenced by TEST_SUITE().

260 {
261  armnn::Graph graph;
262 
263  // Creates the PReLU layer
264  CreatePreluLayerHelper(graph, { 1, 4, 1, 2 }, { 5, 4, 3, 1 }, { 5, 4, 3, 2 });
265 
266  // Graph::InferTensorInfos calls Layer::ValidateTensorShapesFromInputs
267  CHECK_NOTHROW(graph.InferTensorInfos());
268 }
void CreatePreluLayerHelper(armnn::Graph &graph, const armnn::TensorShape &inputShape, const armnn::TensorShape &alphaShape, const armnn::TensorShape &outputShape)
void InferTensorInfos()
Definition: Graph.cpp:529

◆ PreluValidateTensorShapesFromInputsNoMatchTest()

void PreluValidateTensorShapesFromInputsNoMatchTest ( )

Definition at line 270 of file InferOutputTests.hpp.

References CreatePreluLayerHelper(), and Graph::InferTensorInfos().

Referenced by TEST_SUITE().

271 {
272  armnn::Graph graph;
273 
274  // Creates the PReLU layer
275  CreatePreluLayerHelper(graph, { 1, 4, 1, 2 }, { 5, 4, 3, 1 }, { 5, 7, 3, 2 });
276 
277  // Graph::InferTensorInfos calls Layer::ValidateTensorShapesFromInputs
278  CHECK_THROWS_AS(graph.InferTensorInfos(), armnn::LayerValidationException);
279 }
void CreatePreluLayerHelper(armnn::Graph &graph, const armnn::TensorShape &inputShape, const armnn::TensorShape &alphaShape, const armnn::TensorShape &outputShape)
void InferTensorInfos()
Definition: Graph.cpp:529

◆ QLstmInferOutputShapeImpl()

void QLstmInferOutputShapeImpl ( const armnn::QLstmDescriptor  descriptor,
const std::vector< armnn::TensorShape > &  inputShapes,
std::vector< armnn::TensorShape > &  outputShapes 
)

Definition at line 532 of file InferOutputTests.hpp.

References Graph::AddLayer(), and QLstmLayer::InferOutputShapes().

Referenced by QLstmInferOutputShapeTest().

535 {
536  armnn::Graph graph;
537  armnn::QLstmLayer* const qLstmLayer = graph.AddLayer<armnn::QLstmLayer>(descriptor, "qLstm");
538  outputShapes = qLstmLayer->InferOutputShapes(inputShapes);
539 }
LayerT * AddLayer(Args &&... args)
Adds a new layer, of type LayerType, to the graph constructed with the arguments passed.
Definition: Graph.hpp:402
This layer represents a QLstm operation.
Definition: QLstmLayer.hpp:79
std::vector< TensorShape > InferOutputShapes(const std::vector< TensorShape > &inputShapes) const override
By default returns inputShapes if the number of inputs are equal to number of outputs, otherwise infers the output shapes from given input shapes and layer properties.
Definition: QLstmLayer.cpp:153

◆ QLstmInferOutputShapeTest()

void QLstmInferOutputShapeTest ( )

Definition at line 541 of file InferOutputTests.hpp.

References QLstmDescriptor::m_CifgEnabled, QLstmDescriptor::m_PeepholeEnabled, QLstmDescriptor::m_ProjectionEnabled, and QLstmInferOutputShapeImpl().

Referenced by TEST_SUITE().

542 {
543  armnn::QLstmDescriptor descriptor;
544  descriptor.m_PeepholeEnabled = true;
545  descriptor.m_CifgEnabled = false;
546  descriptor.m_ProjectionEnabled = false;
547 
548  // Input shapes
549  const std::vector<unsigned int> inputShape{ 2, 5 };
550  const std::vector<unsigned int> previousOutputInShape{ 2, 4 };
551  const std::vector<unsigned int> previousCellStateInShape{ 2, 4 };
552 
553  armnn::TensorShape inputTensorShape(2, inputShape.data());
554  armnn::TensorShape previousOutputInTensorShape(2, previousOutputInShape.data());
555  armnn::TensorShape previousCellStateInTensorShape(2, previousCellStateInShape.data());
556 
557  std::vector<armnn::TensorShape> inShapes
558  {
559  inputTensorShape,
560  previousOutputInTensorShape,
561  previousCellStateInTensorShape
562  };
563 
564  // Output shapes
565  const std::vector<unsigned int> outputStateOutShape{ 2, 4 };
566  const std::vector<unsigned int> cellStateOutShape{ 2, 4 };
567  const std::vector<unsigned int> outputShape{ 2, 4 };
568  armnn::TensorShape outputStateOutTensorShape(2, outputShape.data());
569  armnn::TensorShape cellStateOutTensorShape(2, cellStateOutShape.data());
570  armnn::TensorShape outputTensorShape(2, outputShape.data());
571 
572  std::vector<armnn::TensorShape> expectedOutShapes
573  {
574  outputStateOutTensorShape,
575  cellStateOutTensorShape,
576  outputTensorShape
577  };
578 
579  std::vector<armnn::TensorShape> actualOutShapes;
580  CHECK_NOTHROW(QLstmInferOutputShapeImpl(descriptor, inShapes, actualOutShapes));
581 
582  CHECK(actualOutShapes.size() == 3);
583  CHECK(expectedOutShapes[0] == actualOutShapes[0]);
584  CHECK(expectedOutShapes[1] == actualOutShapes[1]);
585  CHECK(expectedOutShapes[2] == actualOutShapes[2]);
586 }
bool m_PeepholeEnabled
Enable/disable peephole.
A QLstmDescriptor for the QLstmLayer.
void QLstmInferOutputShapeImpl(const armnn::QLstmDescriptor descriptor, const std::vector< armnn::TensorShape > &inputShapes, std::vector< armnn::TensorShape > &outputShapes)
bool m_ProjectionEnabled
Enable/disable the projection layer.
bool m_CifgEnabled
Enable/disable CIFG (coupled input & forget gate).

◆ QuantizedLstmInferOutputShapeImpl()

void QuantizedLstmInferOutputShapeImpl ( const std::vector< armnn::TensorShape > &  inputShapes,
std::vector< armnn::TensorShape > &  outputShapes 
)

Definition at line 589 of file InferOutputTests.hpp.

References Graph::AddLayer(), and QuantizedLstmLayer::InferOutputShapes().

Referenced by QuantizedLstmInferOutputShapeTest().

591 {
592  armnn::Graph graph;
593  armnn::QuantizedLstmLayer* const quantizedLstmLayer = graph.AddLayer<armnn::QuantizedLstmLayer>("quantizedLstm");
594  outputShapes = quantizedLstmLayer->InferOutputShapes(inputShapes);
595 }
LayerT * AddLayer(Args &&... args)
Adds a new layer, of type LayerType, to the graph constructed with the arguments passed.
Definition: Graph.hpp:402
This layer represents a QuantizedLstm operation.
std::vector< TensorShape > InferOutputShapes(const std::vector< TensorShape > &inputShapes) const override
By default returns inputShapes if the number of inputs are equal to number of outputs, otherwise infers the output shapes from given input shapes and layer properties.

◆ QuantizedLstmInferOutputShapeTest()

void QuantizedLstmInferOutputShapeTest ( )

Definition at line 597 of file InferOutputTests.hpp.

References QuantizedLstmInferOutputShapeImpl().

Referenced by TEST_SUITE().

598 {
599  // Input shapes
600  const std::vector<unsigned int> inputShape{ 2, 5 };
601  const std::vector<unsigned int> previousCellStateInShape{ 2, 10 };
602  const std::vector<unsigned int> previousOutputInShape{ 2, 10 };
603  armnn::TensorShape inputTensorShape(2, inputShape.data());
604  armnn::TensorShape previousCellStateInTensorShape(2, previousCellStateInShape.data());
605  armnn::TensorShape previousOutputInTensorShape(2, previousOutputInShape.data());
606 
607  std::vector<armnn::TensorShape> inShapes
608  {
609  inputTensorShape,
610  previousCellStateInTensorShape,
611  previousOutputInTensorShape
612  };
613 
614  // Output shapes
615  const std::vector<unsigned int> cellStateOutShape{ 2, 10 };
616  const std::vector<unsigned int> outputShape{ 2, 10 };
617  armnn::TensorShape cellStateOutTensorShape(2, cellStateOutShape.data());
618  armnn::TensorShape outputTensorShape(2, outputShape.data());
619 
620  std::vector<armnn::TensorShape> expectedOutShapes
621  {
622  cellStateOutTensorShape,
623  outputTensorShape
624  };
625 
626  std::vector<armnn::TensorShape> actualOutShapes;
627  CHECK_NOTHROW(QuantizedLstmInferOutputShapeImpl(inShapes, actualOutShapes));
628 
629  CHECK(actualOutShapes.size() == 2);
630  CHECK(expectedOutShapes[0] == actualOutShapes[0]);
631  CHECK(expectedOutShapes[1] == actualOutShapes[1]);
632 }
void QuantizedLstmInferOutputShapeImpl(const std::vector< armnn::TensorShape > &inputShapes, std::vector< armnn::TensorShape > &outputShapes)

◆ SpaceToDepthInferOutputShapeTest()

void SpaceToDepthInferOutputShapeTest ( )

Definition at line 127 of file InferOutputTests.hpp.

References Graph::AddLayer(), SpaceToDepthLayer::InferOutputShapes(), SpaceToDepthDescriptor::m_BlockSize, SpaceToDepthDescriptor::m_DataLayout, and armnn::NHWC.

Referenced by TEST_SUITE().

128 {
129  armnn::Graph graph;
130 
132  descriptor.m_BlockSize = 2;
134 
135  armnn::SpaceToDepthLayer* const spaceToDepthLayer =
136  graph.AddLayer<armnn::SpaceToDepthLayer>(descriptor, "spaceToDepth");
137 
138  std::vector<armnn::TensorShape> shapes;
139  const std::vector<unsigned int> dimSizes{ 1, 16, 8, 3 };
140  armnn::TensorShape shape(4, dimSizes.data());
141  shapes.push_back(shape);
142 
143  const std::vector<unsigned int> expectedDimSizes{ 1, 8, 4, 12 };
144  armnn::TensorShape expectedShape(4, expectedDimSizes.data());
145 
146  CHECK(expectedShape == spaceToDepthLayer->InferOutputShapes(shapes).at(0));
147 }
LayerT * AddLayer(Args &&... args)
Adds a new layer, of type LayerType, to the graph constructed with the arguments passed.
Definition: Graph.hpp:402
This layer represents a SpaceToDepth operation.
A SpaceToDepthDescriptor for the SpaceToDepthLayer.
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).
std::vector< TensorShape > InferOutputShapes(const std::vector< TensorShape > &inputShapes) const override
By default returns inputShapes if the number of inputs are equal to number of outputs, otherwise infers the output shapes from given input shapes and layer properties.

◆ StackInferOutputShapeFromInputsMatchTest()

void StackInferOutputShapeFromInputsMatchTest ( )

Definition at line 290 of file InferOutputTests.hpp.

References StackDescriptor::m_Axis, StackDescriptor::m_InputShape, StackDescriptor::m_NumInputs, and StackInferOutputShapeImpl().

Referenced by TEST_SUITE().

291 {
292  armnn::Graph graph;
293 
294  armnn::StackDescriptor descriptor;
295  descriptor.m_Axis = 1;
296  descriptor.m_NumInputs = 3;
297  descriptor.m_InputShape = armnn::TensorShape
298  (
299  { 4, 2 } // Defined input shape
300  );
301 
302  const std::vector<armnn::TensorShape> inputShapes
303  {
304  { 4, 2 }, // Actual input shapes
305  { 4, 2 },
306  { 4, 2 }
307  };
308 
309  std::vector<armnn::TensorShape> outputShapes;
310  CHECK_NOTHROW(StackInferOutputShapeImpl(descriptor, inputShapes, outputShapes));
311 
312  armnn::TensorShape expectedOutputShape
313  (
314  { 4, 3, 2 }
315  );
316  CHECK(outputShapes.size() == 1);
317  CHECK(outputShapes[0] == expectedOutputShape);
318 }
void StackInferOutputShapeImpl(const armnn::StackDescriptor descriptor, const std::vector< armnn::TensorShape > &inputShapes, std::vector< armnn::TensorShape > &outputShapes)
uint32_t m_Axis
0-based axis along which to stack the input tensors.
TensorShape m_InputShape
Required shape of all input tensors.
A StackDescriptor for the StackLayer.
uint32_t m_NumInputs
Number of input tensors.

◆ StackInferOutputShapeFromInputsNoMatchTest()

void StackInferOutputShapeFromInputsNoMatchTest ( )

Definition at line 320 of file InferOutputTests.hpp.

References StackDescriptor::m_Axis, StackDescriptor::m_InputShape, StackDescriptor::m_NumInputs, and StackInferOutputShapeImpl().

Referenced by TEST_SUITE().

321 {
322  armnn::Graph graph;
323 
324  armnn::StackDescriptor descriptor;
325  descriptor.m_Axis = 1;
326  descriptor.m_NumInputs = 3;
327  descriptor.m_InputShape = armnn::TensorShape
328  (
329  { 4, 2 } // Defined input shape
330  );
331 
332  const std::vector<armnn::TensorShape> inputShapes
333  {
334  { 4, 2 }, // Actual input shapes
335  { 4, 5 }, // Incorrectly shaped input tensor
336  { 4, 2 }
337  };
338 
339  // Output shape is inferred from the descriptor, so should still be correct despite mismatching input shapes
340  std::vector<armnn::TensorShape> outputShapes;
341  CHECK_NOTHROW(StackInferOutputShapeImpl(descriptor, inputShapes, outputShapes));
342 
343  armnn::TensorShape expectedOutputShape
344  (
345  { 4, 3, 2 }
346  );
347  CHECK(outputShapes.size() == 1);
348  CHECK(outputShapes[0] == expectedOutputShape);
349 }
void StackInferOutputShapeImpl(const armnn::StackDescriptor descriptor, const std::vector< armnn::TensorShape > &inputShapes, std::vector< armnn::TensorShape > &outputShapes)
uint32_t m_Axis
0-based axis along which to stack the input tensors.
TensorShape m_InputShape
Required shape of all input tensors.
A StackDescriptor for the StackLayer.
uint32_t m_NumInputs
Number of input tensors.

◆ StackInferOutputShapeImpl()

void StackInferOutputShapeImpl ( const armnn::StackDescriptor  descriptor,
const std::vector< armnn::TensorShape > &  inputShapes,
std::vector< armnn::TensorShape > &  outputShapes 
)

Definition at line 281 of file InferOutputTests.hpp.

References Graph::AddLayer(), and StackLayer::InferOutputShapes().

Referenced by StackInferOutputShapeFromInputsMatchTest(), and StackInferOutputShapeFromInputsNoMatchTest().

284 {
285  armnn::Graph graph;
286  armnn::StackLayer* const stackLayer = graph.AddLayer<armnn::StackLayer>(descriptor, "stack");
287  outputShapes = stackLayer->InferOutputShapes(inputShapes);
288 }
std::vector< TensorShape > InferOutputShapes(const std::vector< TensorShape > &inputShapes) const override
By default returns inputShapes if the number of inputs are equal to number of outputs, otherwise infers the output shapes from given input shapes and layer properties.
Definition: StackLayer.cpp:35
LayerT * AddLayer(Args &&... args)
Adds a new layer, of type LayerType, to the graph constructed with the arguments passed.
Definition: Graph.hpp:402
This layer represents a stack operation.
Definition: StackLayer.hpp:13

◆ StackValidateTensorShapesFromInputsMatchTest()

void StackValidateTensorShapesFromInputsMatchTest ( )

Definition at line 382 of file InferOutputTests.hpp.

References CreateStackLayerHelper(), Graph::InferTensorInfos(), StackDescriptor::m_Axis, StackDescriptor::m_InputShape, and StackDescriptor::m_NumInputs.

Referenced by TEST_SUITE().

383 {
384  armnn::Graph graph;
385 
386  armnn::StackDescriptor descriptor;
387  descriptor.m_Axis = 0;
388  descriptor.m_NumInputs = 3;
389  descriptor.m_InputShape = armnn::TensorShape
390  (
391  { 2, 5 } // Defined input shape
392  );
393 
394  const std::vector<armnn::TensorShape> inputShapes
395  {
396  { 2, 5 }, // Actual input shapes
397  { 2, 5 },
398  { 2, 5 }
399  };
400 
401  // Creates the Stack layer
402  CreateStackLayerHelper(graph, descriptor, inputShapes, { 3, 2, 5 });
403 
404  // Graph::InferTensorInfos calls Layer::ValidateTensorShapesFromInputs
405  CHECK_NOTHROW(graph.InferTensorInfos());
406 }
uint32_t m_Axis
0-based axis along which to stack the input tensors.
TensorShape m_InputShape
Required shape of all input tensors.
A StackDescriptor for the StackLayer.
void CreateStackLayerHelper(armnn::Graph &graph, const armnn::StackDescriptor &descriptor, const std::vector< armnn::TensorShape > &inputShapes, const armnn::TensorShape &outputShape)
uint32_t m_NumInputs
Number of input tensors.
void InferTensorInfos()
Definition: Graph.cpp:529

◆ StackValidateTensorShapesFromInputsNoMatchTest()

void StackValidateTensorShapesFromInputsNoMatchTest ( )

Definition at line 408 of file InferOutputTests.hpp.

References CreateStackLayerHelper(), Graph::InferTensorInfos(), StackDescriptor::m_Axis, StackDescriptor::m_InputShape, and StackDescriptor::m_NumInputs.

Referenced by TEST_SUITE().

409 {
410  armnn::Graph graph;
411 
412  armnn::StackDescriptor descriptor;
413  descriptor.m_Axis = 0;
414  descriptor.m_NumInputs = 3;
415  descriptor.m_InputShape = armnn::TensorShape
416  (
417  { 2, 5 } // Defined input shape
418  );
419 
420  const std::vector<armnn::TensorShape> inputShapes
421  {
422  { 2, 5 }, // Actual input shapes
423  { 2, 2 }, // Incorrectly shaped input tensor
424  { 2, 5 }
425  };
426 
427  // Creates the Stack layer
428  CreateStackLayerHelper(graph, descriptor, inputShapes, { 3, 2, 5 });
429 
430  // Graph::InferTensorInfos calls Layer::ValidateTensorShapesFromInputs
431  CHECK_THROWS_AS(graph.InferTensorInfos(), armnn::LayerValidationException);
432 }
uint32_t m_Axis
0-based axis along which to stack the input tensors.
TensorShape m_InputShape
Required shape of all input tensors.
A StackDescriptor for the StackLayer.
void CreateStackLayerHelper(armnn::Graph &graph, const armnn::StackDescriptor &descriptor, const std::vector< armnn::TensorShape > &inputShapes, const armnn::TensorShape &outputShape)
uint32_t m_NumInputs
Number of input tensors.
void InferTensorInfos()
Definition: Graph.cpp:529

◆ TransposeConvolution2dInferOutputShapeTest()

void TransposeConvolution2dInferOutputShapeTest ( )

Definition at line 467 of file InferOutputTests.hpp.

References Graph::AddLayer(), TransposeConvolution2dLayer::InferOutputShapes(), TransposeConvolution2dDescriptor::m_DataLayout, TransposeConvolution2dDescriptor::m_PadBottom, TransposeConvolution2dDescriptor::m_PadLeft, TransposeConvolution2dDescriptor::m_PadRight, TransposeConvolution2dDescriptor::m_PadTop, TransposeConvolution2dDescriptor::m_StrideX, TransposeConvolution2dDescriptor::m_StrideY, and armnn::NCHW.

Referenced by TEST_SUITE().

468 {
469  armnn::Graph graph;
470 
472  descriptor.m_PadTop = 0;
473  descriptor.m_PadBottom = 1;
474  descriptor.m_PadLeft = 0;
475  descriptor.m_PadRight = 1;
476  descriptor.m_StrideX = 2;
477  descriptor.m_StrideY = 2;
479 
480  armnn::TransposeConvolution2dLayer* const transposeConvolution2dLayer =
481  graph.AddLayer<armnn::TransposeConvolution2dLayer>(descriptor, "TransposeConvolution2d");
482 
483  std::vector<armnn::TensorShape> shapes;
484  const std::vector<unsigned int> inputSize = {1, 2, 3, 3};
485  armnn::TensorShape inputShape(4, inputSize.data());
486  shapes.push_back(inputShape);
487 
488  const std::vector<unsigned int> filterSize = { 1, 2, 3, 3};
489  armnn::TensorShape filterShape(4, filterSize.data());
490  shapes.push_back(filterShape);
491 
492  const std::vector<unsigned int> expectedOutputSizes = {1, 1, 6, 6};
493  armnn::TensorShape expectedOutputShape(4, expectedOutputSizes.data());
494 
495  CHECK(expectedOutputShape == transposeConvolution2dLayer->InferOutputShapes(shapes).at(0));
496 }
This layer represents a 2D transpose convolution operation.
A TransposeConvolution2dDescriptor for the TransposeConvolution2dLayer.
LayerT * AddLayer(Args &&... args)
Adds a new layer, of type LayerType, to the graph constructed with the arguments passed.
Definition: Graph.hpp:402
uint32_t m_PadBottom
Padding bottom value in the height dimension.
uint32_t m_PadTop
Padding top value in the height dimension.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
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.
uint32_t m_StrideY
Stride value when proceeding through input for the height dimension.
uint32_t m_PadRight
Padding right value in the width dimension.
std::vector< TensorShape > InferOutputShapes(const std::vector< TensorShape > &inputShapes) const override
Infers the output shapes from given input shapes and layer properties.