From fd627ffaec8fd8801d980b4c91ee7c0607ab6aaf Mon Sep 17 00:00:00 2001 From: Jan Eilers Date: Thu, 25 Feb 2021 17:44:00 +0000 Subject: IVGCVSW-5687 Update Doxygen Docu * Update Doxygen Documentation for 21.02 release Signed-off-by: Jan Eilers Change-Id: I9ed2f9caab038836ea99d7b378d7899fe431a4e5 --- 21.02/class_layer_verifier_base.xhtml | 379 ++++++++++++++++++++++++++++++++++ 1 file changed, 379 insertions(+) create mode 100644 21.02/class_layer_verifier_base.xhtml (limited to '21.02/class_layer_verifier_base.xhtml') diff --git a/21.02/class_layer_verifier_base.xhtml b/21.02/class_layer_verifier_base.xhtml new file mode 100644 index 0000000000..4f5ccc47bd --- /dev/null +++ b/21.02/class_layer_verifier_base.xhtml @@ -0,0 +1,379 @@ + + + + + + + + + + + + + +ArmNN: LayerVerifierBase Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  21.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
LayerVerifierBase Class Reference
+
+
+ +

#include <SerializerTestUtils.hpp>

+
+Inheritance diagram for LayerVerifierBase:
+
+
+ + +IStrategy +LayerVerifierBaseWithDescriptor< Descriptor > +LayerVerifierBaseWithDescriptor< armnn::OriginsDescriptor > +LayerVerifierBaseWithDescriptor< armnn::ResizeBilinearDescriptor > +LayerVerifierBaseWithDescriptorAndConstants< Descriptor > + +
+ + + + + + + + + + + +

+Public Member Functions

 LayerVerifierBase (const std::string &layerName, const std::vector< armnn::TensorInfo > &inputInfos, const std::vector< armnn::TensorInfo > &outputInfos)
 
void ExecuteStrategy (const armnn::IConnectableLayer *layer, const armnn::BaseDescriptor &descriptor, const std::vector< armnn::ConstTensor > &constants, const char *name, const armnn::LayerBindingId id=0) override
 
- Public Member Functions inherited from IStrategy
virtual void ExecuteStrategy (const armnn::IConnectableLayer *layer, const armnn::BaseDescriptor &descriptor, const std::vector< armnn::ConstTensor > &constants, const char *name, const armnn::LayerBindingId id=0)=0
 
virtual void FinishStrategy ()
 
+ + + + + + + + + + +

+Protected Member Functions

void VerifyNameAndConnections (const armnn::IConnectableLayer *layer, const char *name)
 
void VerifyConstTensors (const std::string &tensorName, const armnn::ConstTensor *expectedPtr, const armnn::ConstTensor *actualPtr)
 
- Protected Member Functions inherited from IStrategy
 IStrategy ()
 
virtual ~IStrategy ()
 
+

Detailed Description

+
+

Definition at line 24 of file SerializerTestUtils.hpp.

+

Constructor & Destructor Documentation

+ +

◆ LayerVerifierBase()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
LayerVerifierBase (const std::string & layerName,
const std::vector< armnn::TensorInfo > & inputInfos,
const std::vector< armnn::TensorInfo > & outputInfos 
)
+
+ +

Definition at line 11 of file SerializerTestUtils.cpp.

+ +

Referenced by BOOST_AUTO_TEST_CASE().

+
14  : m_LayerName(layerName)
15  , m_InputTensorInfos(inputInfos)
16  , m_OutputTensorInfos(outputInfos)
17 {}
+
+
+

Member Function Documentation

+ +

◆ ExecuteStrategy()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void ExecuteStrategy (const armnn::IConnectableLayerlayer,
const armnn::BaseDescriptordescriptor,
const std::vector< armnn::ConstTensor > & constants,
const char * name,
const armnn::LayerBindingId id = 0 
)
+
+override
+
+ +

Definition at line 19 of file SerializerTestUtils.cpp.

+ +

References IConnectableLayer::GetType(), armnn::IgnoreUnused(), armnn::Input, armnn::Output, and VerifyNameAndConnections().

+ +

Referenced by BOOST_AUTO_TEST_CASE().

+
24 {
25  armnn::IgnoreUnused(descriptor, constants, id);
26  switch (layer->GetType())
27  {
28  case armnn::LayerType::Input: break;
29  case armnn::LayerType::Output: break;
30  default:
31  {
32  VerifyNameAndConnections(layer, name);
33  }
34  }
35 }
+
void IgnoreUnused(Ts &&...)
+
void VerifyNameAndConnections(const armnn::IConnectableLayer *layer, const char *name)
+
virtual LayerType GetType() const =0
Returns the armnn::LayerType of this layer.
+ +
+
+
+ +

◆ VerifyConstTensors()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void VerifyConstTensors (const std::string & tensorName,
const armnn::ConstTensorexpectedPtr,
const armnn::ConstTensoractualPtr 
)
+
+protected
+
+ +

Definition at line 71 of file SerializerTestUtils.cpp.

+ +

References TensorInfo::GetDataType(), armnn::GetDataTypeName(), BaseTensor< MemoryType >::GetInfo(), BaseTensor< MemoryType >::GetMemoryArea(), BaseTensor< MemoryType >::GetNumBytes(), and TensorInfo::GetShape().

+ +

Referenced by ConstantVector2LstmInputParams().

+
74 {
75  if (expectedPtr == nullptr)
76  {
77  BOOST_CHECK_MESSAGE(actualPtr == nullptr, tensorName + " should not exist");
78  }
79  else
80  {
81  BOOST_CHECK_MESSAGE(actualPtr != nullptr, tensorName + " should have been set");
82  if (actualPtr != nullptr)
83  {
84  const armnn::TensorInfo& expectedInfo = expectedPtr->GetInfo();
85  const armnn::TensorInfo& actualInfo = actualPtr->GetInfo();
86 
87  BOOST_CHECK_MESSAGE(expectedInfo.GetShape() == actualInfo.GetShape(),
88  tensorName + " shapes don't match");
89  BOOST_CHECK_MESSAGE(
90  GetDataTypeName(expectedInfo.GetDataType()) == GetDataTypeName(actualInfo.GetDataType()),
91  tensorName + " data types don't match");
92 
93  BOOST_CHECK_MESSAGE(expectedPtr->GetNumBytes() == actualPtr->GetNumBytes(),
94  tensorName + " (GetNumBytes) data sizes do not match");
95  if (expectedPtr->GetNumBytes() == actualPtr->GetNumBytes())
96  {
97  //check the data is identical
98  const char* expectedData = static_cast<const char*>(expectedPtr->GetMemoryArea());
99  const char* actualData = static_cast<const char*>(actualPtr->GetMemoryArea());
100  bool same = true;
101  for (unsigned int i = 0; i < expectedPtr->GetNumBytes(); ++i)
102  {
103  same = expectedData[i] == actualData[i];
104  if (!same)
105  {
106  break;
107  }
108  }
109  BOOST_CHECK_MESSAGE(same, tensorName + " data does not match");
110  }
111  }
112  }
113 }
const TensorShape & GetShape() const
Definition: Tensor.hpp:187
+ +
MemoryType GetMemoryArea() const
Definition: Tensor.hpp:292
+
constexpr const char * GetDataTypeName(DataType dataType)
Definition: TypesUtils.hpp:180
+
DataType GetDataType() const
Definition: Tensor.hpp:194
+
const TensorInfo & GetInfo() const
Definition: Tensor.hpp:282
+
unsigned int GetNumBytes() const
Definition: Tensor.hpp:289
+
+
+
+ +

◆ VerifyNameAndConnections()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void VerifyNameAndConnections (const armnn::IConnectableLayerlayer,
const char * name 
)
+
+protected
+
+ +

Definition at line 38 of file SerializerTestUtils.cpp.

+ +

References IInputSlot::GetConnection(), TensorInfo::GetDataType(), armnn::GetDataTypeName(), IConnectableLayer::GetInputSlot(), IConnectableLayer::GetNumInputSlots(), IConnectableLayer::GetNumOutputSlots(), IConnectableLayer::GetOutputSlot(), TensorInfo::GetQuantizationOffset(), TensorInfo::GetQuantizationScale(), TensorInfo::GetShape(), and IOutputSlot::GetTensorInfo().

+ +

Referenced by BOOST_AUTO_TEST_CASE(), ConstantVector2LstmInputParams(), ExecuteStrategy(), LayerVerifierBaseWithDescriptor< armnn::OriginsDescriptor >::ExecuteStrategy(), and LayerVerifierBaseWithDescriptorAndConstants< Descriptor >::ExecuteStrategy().

+
39 {
40  BOOST_TEST(name == m_LayerName.c_str());
41 
42  BOOST_TEST(layer->GetNumInputSlots() == m_InputTensorInfos.size());
43  BOOST_TEST(layer->GetNumOutputSlots() == m_OutputTensorInfos.size());
44 
45  for (unsigned int i = 0; i < m_InputTensorInfos.size(); i++)
46  {
47  const armnn::IOutputSlot* connectedOutput = layer->GetInputSlot(i).GetConnection();
48  BOOST_CHECK(connectedOutput);
49 
50  const armnn::TensorInfo& connectedInfo = connectedOutput->GetTensorInfo();
51  BOOST_TEST(connectedInfo.GetShape() == m_InputTensorInfos[i].GetShape());
52  BOOST_TEST(
53  GetDataTypeName(connectedInfo.GetDataType()) == GetDataTypeName(m_InputTensorInfos[i].GetDataType()));
54 
55  BOOST_TEST(connectedInfo.GetQuantizationScale() == m_InputTensorInfos[i].GetQuantizationScale());
56  BOOST_TEST(connectedInfo.GetQuantizationOffset() == m_InputTensorInfos[i].GetQuantizationOffset());
57  }
58 
59  for (unsigned int i = 0; i < m_OutputTensorInfos.size(); i++)
60  {
61  const armnn::TensorInfo& outputInfo = layer->GetOutputSlot(i).GetTensorInfo();
62  BOOST_TEST(outputInfo.GetShape() == m_OutputTensorInfos[i].GetShape());
63  BOOST_TEST(
64  GetDataTypeName(outputInfo.GetDataType()) == GetDataTypeName(m_OutputTensorInfos[i].GetDataType()));
65 
66  BOOST_TEST(outputInfo.GetQuantizationScale() == m_OutputTensorInfos[i].GetQuantizationScale());
67  BOOST_TEST(outputInfo.GetQuantizationOffset() == m_OutputTensorInfos[i].GetQuantizationOffset());
68  }
69 }
virtual unsigned int GetNumOutputSlots() const =0
Returns the number of connectable output slots.
+
virtual unsigned int GetNumInputSlots() const =0
Returns the number of connectable input slots.
+
const TensorShape & GetShape() const
Definition: Tensor.hpp:187
+ +
constexpr const char * GetDataTypeName(DataType dataType)
Definition: TypesUtils.hpp:180
+
An output connection slot for a layer.
Definition: INetwork.hpp:38
+
int32_t GetQuantizationOffset() const
Definition: Tensor.cpp:469
+
float GetQuantizationScale() const
Definition: Tensor.cpp:452
+
DataType GetDataType() const
Definition: Tensor.hpp:194
+
virtual const IInputSlot & GetInputSlot(unsigned int index) const =0
Get a const input slot handle by slot index.
+
virtual const IOutputSlot * GetConnection() const =0
+
virtual const TensorInfo & GetTensorInfo() const =0
+
virtual const IOutputSlot & GetOutputSlot(unsigned int index) const =0
Get the const output slot handle by slot index.
+
+
+
+
The documentation for this class was generated from the following files: +
+
+ + + + -- cgit v1.2.1