From de36e4a9c299028e792c3a5bd99ad0816d806077 Mon Sep 17 00:00:00 2001 From: Ryan OShea Date: Fri, 13 Mar 2020 16:26:19 +0000 Subject: IVGCVSW-3726 Upload ArmNN Doxygen files * Upload current ArmNN Doxygen files Signed-off-by: Ryan OShea Change-Id: I8989ed16ee40a99a4495b100bd009cf3e24a7285 --- ...assarmnn_quantizer_1_1_quantization_input.xhtml | 395 +++++++++++++++++++++ 1 file changed, 395 insertions(+) create mode 100644 Documentation/classarmnn_quantizer_1_1_quantization_input.xhtml (limited to 'Documentation/classarmnn_quantizer_1_1_quantization_input.xhtml') diff --git a/Documentation/classarmnn_quantizer_1_1_quantization_input.xhtml b/Documentation/classarmnn_quantizer_1_1_quantization_input.xhtml new file mode 100644 index 0000000000..1816e85292 --- /dev/null +++ b/Documentation/classarmnn_quantizer_1_1_quantization_input.xhtml @@ -0,0 +1,395 @@ + + + + + + + + + + + + + +ArmNN: QuantizationInput Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
QuantizationInput Class Reference
+
+
+ +

QuantizationInput for specific pass ID, can list a corresponding raw data file for each LayerBindingId. + More...

+ +

#include <QuantizationInput.hpp>

+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 QuantizationInput (const unsigned int passId, const armnn::LayerBindingId bindingId, const std::string fileName)
 Constructor for QuantizationInput. More...
 
 QuantizationInput (const QuantizationInput &other)
 
void AddEntry (const armnn::LayerBindingId bindingId, const std::string fileName)
 
std::vector< float > GetDataForEntry (const armnn::LayerBindingId bindingId) const
 
std::vector< armnn::LayerBindingIdGetLayerBindingIds () const
 Retrieve Layer Binding IDs for this QuantizationInput. More...
 
unsigned long GetNumberOfInputs () const
 Get number of inputs for this QuantizationInput. More...
 
unsigned int GetPassId () const
 Retrieve Pass ID for this QuantizationInput. More...
 
std::string GetFileName (const armnn::LayerBindingId bindingId) const
 Retrieve filename path for specified Layer Binding ID. More...
 
 ~QuantizationInput () noexcept
 Destructor. More...
 
+

Detailed Description

+

QuantizationInput for specific pass ID, can list a corresponding raw data file for each LayerBindingId.

+ +

Definition at line 16 of file QuantizationInput.hpp.

+

Constructor & Destructor Documentation

+ +

◆ QuantizationInput() [1/2]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
QuantizationInput (const unsigned int passId,
const armnn::LayerBindingId bindingId,
const std::string fileName 
)
+
+ +

Constructor for QuantizationInput.

+ +

Definition at line 16 of file QuantizationInput.cpp.

+
18  :
19  m_PassId(passId)
20 {
21  m_LayerBindingIdToFileName.emplace(bindingId, fileName);
22 }
+
+
+ +

◆ QuantizationInput() [2/2]

+ +
+
+ + + + + + + + +
QuantizationInput (const QuantizationInputother)
+
+ +

Definition at line 24 of file QuantizationInput.cpp.

+ +

References QuantizationInput::AddEntry(), QuantizationInput::GetFileName(), QuantizationInput::GetLayerBindingIds(), and QuantizationInput::GetPassId().

+
25 {
26  m_PassId = other.GetPassId();
27  m_LayerBindingIdToFileName.clear();
28  for (armnn::LayerBindingId bindingId : other.GetLayerBindingIds())
29  {
30  std::string filename = other.GetFileName(bindingId);
31  AddEntry(bindingId, filename);
32  }
33 }
void AddEntry(const armnn::LayerBindingId bindingId, const std::string fileName)
+
int LayerBindingId
Type of identifiers for bindable layers (inputs, outputs).
Definition: Types.hpp:171
+
+
+
+ +

◆ ~QuantizationInput()

+ +
+
+ + + + + +
+ + + + + + + +
~QuantizationInput ()
+
+noexcept
+
+ +

Destructor.

+ +

Definition at line 99 of file QuantizationInput.cpp.

+
100 {
101 }
+
+
+

Member Function Documentation

+ +

◆ AddEntry()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void AddEntry (const armnn::LayerBindingId bindingId,
const std::string fileName 
)
+
+ +

Definition at line 35 of file QuantizationInput.cpp.

+ +

Referenced by QuantizationInput::QuantizationInput().

+
36 {
37  m_LayerBindingIdToFileName.emplace(bindingId, fileName);
38 }
+
+
+ +

◆ GetDataForEntry()

+ +
+
+ + + + + + + + +
std::vector< float > GetDataForEntry (const armnn::LayerBindingId bindingId) const
+
+ +

Definition at line 40 of file QuantizationInput.cpp.

+
41 {
42  if (m_LayerBindingIdToFileName.at(bindingId).empty())
43  {
44  throw armnn::Exception("Layer binding ID not found");
45  }
46 
47  std::string fileName = m_LayerBindingIdToFileName.at(bindingId);
48  std::ifstream in(fileName.c_str(), std::ifstream::binary);
49  if (!in.is_open())
50  {
51  throw armnn::Exception("Failed to open input tensor file " + fileName);
52  }
53 
54  std::string line;
55  std::vector<float> values;
56  char* pEnd;
57 
58  while (std::getline(in, line, ' '))
59  {
60  values.emplace_back(std::strtof(line.c_str(), &pEnd));
61  }
62  return values;
63 }
Base class for all ArmNN exceptions so that users can filter to just those.
Definition: Exceptions.hpp:46
+
+
+
+ +

◆ GetFileName()

+ +
+
+ + + + + + + + +
std::string GetFileName (const armnn::LayerBindingId bindingId) const
+
+ +

Retrieve filename path for specified Layer Binding ID.

+ +

Definition at line 86 of file QuantizationInput.cpp.

+ +

Referenced by QuantizationInput::QuantizationInput().

+
87 {
88  auto iterator = m_LayerBindingIdToFileName.find(bindingId);
89  if (iterator != m_LayerBindingIdToFileName.end())
90  {
91  return m_LayerBindingIdToFileName.at(bindingId);
92  }
93  else
94  {
95  throw armnn::Exception("Could not retrieve filename for binding ID " + std::to_string(bindingId));
96  }
97 }
Base class for all ArmNN exceptions so that users can filter to just those.
Definition: Exceptions.hpp:46
+
+
+
+ +

◆ GetLayerBindingIds()

+ +
+
+ + + + + + + +
std::vector< armnn::LayerBindingId > GetLayerBindingIds () const
+
+ +

Retrieve Layer Binding IDs for this QuantizationInput.

+ +

Definition at line 65 of file QuantizationInput.cpp.

+ +

Referenced by QuantizationInput::QuantizationInput().

+
66 {
67  std::vector<armnn::LayerBindingId> layerBindingIDs;
68 
69  for (auto iterator = m_LayerBindingIdToFileName.begin(); iterator != m_LayerBindingIdToFileName.end(); ++iterator)
70  {
71  layerBindingIDs.emplace_back(iterator->first);
72  }
73  return layerBindingIDs;
74 }
+
+
+ +

◆ GetNumberOfInputs()

+ +
+
+ + + + + + + +
unsigned long GetNumberOfInputs () const
+
+ +

Get number of inputs for this QuantizationInput.

+ +

Definition at line 76 of file QuantizationInput.cpp.

+
77 {
78  return m_LayerBindingIdToFileName.size();
79 }
+
+
+ +

◆ GetPassId()

+ +
+
+ + + + + + + +
unsigned int GetPassId () const
+
+ +

Retrieve Pass ID for this QuantizationInput.

+ +

Definition at line 81 of file QuantizationInput.cpp.

+ +

Referenced by QuantizationInput::QuantizationInput().

+
82 {
83  return m_PassId;
84 }
+
+
+
The documentation for this class was generated from the following files: +
+
+ + + + -- cgit v1.2.1