#include <NetworkExecutionUtils.hpp>
|
| TensorPrinter (const std::string &binding, const armnn::TensorInfo &info, const std::string &outputTensorFile, bool dequantizeOutput, bool printToConsole=true) |
|
void | operator() (const std::vector< float > &values) |
|
void | operator() (const std::vector< uint8_t > &values) |
|
void | operator() (const std::vector< int > &values) |
|
void | operator() (const std::vector< int8_t > &values) |
|
Definition at line 23 of file NetworkExecutionUtils.hpp.
◆ TensorPrinter()
TensorPrinter |
( |
const std::string & |
binding, |
|
|
const armnn::TensorInfo & |
info, |
|
|
const std::string & |
outputTensorFile, |
|
|
bool |
dequantizeOutput, |
|
|
bool |
printToConsole = true |
|
) |
| |
Definition at line 116 of file NetworkExecutionUtils.cpp.
121 : m_OutputBinding(binding)
124 , m_OutputTensorFile(outputTensorFile)
125 , m_DequantizeOutput(dequantizeOutput)
126 , m_PrintToConsole(printToConsole) {}
int32_t GetQuantizationOffset() const
float GetQuantizationScale() const
◆ operator()() [1/4]
void operator() |
( |
const std::vector< float > & |
values | ) |
|
Definition at line 128 of file NetworkExecutionUtils.cpp.
Referenced by operator()().
130 if (m_PrintToConsole)
132 std::cout << m_OutputBinding <<
": ";
133 ForEachValue(values, [](
float value)
135 printf(
"%f ", value);
◆ operator()() [2/4]
void operator() |
( |
const std::vector< uint8_t > & |
values | ) |
|
Definition at line 142 of file NetworkExecutionUtils.cpp.
References armnn::Dequantize(), and operator()().
144 if(m_DequantizeOutput)
146 auto& scale = m_Scale;
147 auto& offset = m_Offset;
148 std::vector<float> dequantizedValues;
149 ForEachValue(values, [&scale, &offset, &dequantizedValues](uint8_t value)
152 dequantizedValues.push_back(dequantizedValue);
155 if (m_PrintToConsole)
157 std::cout << m_OutputBinding <<
": ";
158 ForEachValue(dequantizedValues, [](
float value)
160 printf(
"%f ", value);
165 WriteToFile(dequantizedValues);
169 const std::vector<int> intValues(values.begin(), values.end());
float Dequantize(QuantizedType value, float scale, int32_t offset)
Dequantize an 8-bit data type into a floating point data type.
void operator()(const std::vector< float > &values)
◆ operator()() [3/4]
void operator() |
( |
const std::vector< int > & |
values | ) |
|
Definition at line 188 of file NetworkExecutionUtils.cpp.
References ARMNN_LOG.
190 if (m_PrintToConsole)
192 std::cout << m_OutputBinding <<
": ";
193 ForEachValue(values, [](
int value)
195 printf(
"%d ", value);
◆ operator()() [4/4]
void operator() |
( |
const std::vector< int8_t > & |
values | ) |
|
Definition at line 174 of file NetworkExecutionUtils.cpp.
176 if (m_PrintToConsole)
178 std::cout << m_OutputBinding <<
": ";
179 ForEachValue(values, [](int8_t value)
181 printf(
"%d ", value);
The documentation for this struct was generated from the following files: