From 6940dd720ebb6b3d1df8ca203ab696daefe58189 Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Fri, 20 Mar 2020 12:25:56 +0000 Subject: renamed Documentation folder 20.02 and added .nojekyll file Signed-off-by: Jim Flynn --- ...assarmnn_quantizer_1_1_quantization_input.xhtml | 395 +++++++++++++++++++++ 1 file changed, 395 insertions(+) create mode 100644 20.02/classarmnn_quantizer_1_1_quantization_input.xhtml (limited to '20.02/classarmnn_quantizer_1_1_quantization_input.xhtml') diff --git a/20.02/classarmnn_quantizer_1_1_quantization_input.xhtml b/20.02/classarmnn_quantizer_1_1_quantization_input.xhtml new file mode 100644 index 0000000000..1816e85292 --- /dev/null +++ b/20.02/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