MCPcopy Create free account
hub / github.com/ARM-software/armnn / PrintNetworkInfo

Method PrintNetworkInfo

tests/ExecuteNetwork/ArmNNExecutor.cpp:303–359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

301}
302
303void ArmNNExecutor::PrintNetworkInfo()
304{
305 const std::vector<std::string>& inputNames = m_Params.m_InputNames.size() != 0 ?
306 m_Params.m_InputNames :
307 m_IOInfo.m_InputNames;
308 std::stringstream ss;
309 ss << "===== Network Info =====\n";
310 ss << "Inputs in order:\n";
311 for (const auto& inputName : inputNames)
312 {
313 const auto inputInfo = m_IOInfo.m_InputInfoMap[inputName].second;
314 ss << inputName << ", " << inputInfo.GetShape() << ", " << GetDataTypeName(inputInfo.GetDataType());
315 if (inputInfo.IsQuantized())
316 {
317 ss << " Quantization Offset: " << inputInfo.GetQuantizationOffset();
318 if (inputInfo.HasMultipleQuantizationScales())
319 {
320 ss << " Quantization scales: ";
321 for (const auto scale: inputInfo.GetQuantizationScales())
322 {
323 ss << scale << ", ";
324 }
325 }
326 else
327 {
328 ss << " Quantization scale: " << inputInfo.GetQuantizationScale();
329 }
330 }
331 ss << "\n";
332 }
333
334 ss << "Outputs in order:\n";
335 for (const auto& outputName : m_IOInfo.m_OutputNames)
336 {
337 const auto outputInfo = m_IOInfo.m_OutputInfoMap[outputName].second;
338 ss << outputName << ", " << outputInfo.GetShape() << ", " << GetDataTypeName(outputInfo.GetDataType());
339 if (outputInfo.IsQuantized())
340 {
341 ss << " Quantization Offset: " << outputInfo.GetQuantizationOffset();
342 if (outputInfo.HasMultipleQuantizationScales())
343 {
344 ss << " Quantization scales: ";
345 for (const auto scale: outputInfo.GetQuantizationScales())
346 {
347 ss << scale << ", ";
348 }
349 }
350 else
351 {
352 ss << " Quantization scale: " << outputInfo.GetQuantizationScale();
353 }
354 }
355 ss << "\n";
356 }
357
358 std::cout << ss.str() << std::endl;
359}
360

Callers 1

mainFunction · 0.45

Calls 10

GetDataTypeNameFunction · 0.85
IsQuantizedMethod · 0.80
GetQuantizationScalesMethod · 0.80
sizeMethod · 0.45
GetShapeMethod · 0.45
GetDataTypeMethod · 0.45
GetQuantizationOffsetMethod · 0.45
GetQuantizationScaleMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected