MCPcopy Create free account
hub / github.com/OpenPPL/ppl.nn / PrintOutputInfo

Function PrintOutputInfo

tools/pplnn.cc:956–982  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

954}
955
956static void PrintOutputInfo(const Runtime* runtime) {
957 cout << "----- output info -----" << endl;
958 for (uint32_t i = 0; i < runtime->GetOutputCount(); ++i) {
959 auto tensor = runtime->GetOutputTensor(i);
960 cout << "output[" << i << "]:" << endl;
961 cout << " name: " << tensor->GetName() << endl;
962
963 string dims_str;
964 auto shape = tensor->GetShape();
965 for (uint32_t j = 0; j < shape->GetDimCount(); ++j) {
966 dims_str += " " + ToString(shape->GetDim(j));
967 }
968 cout << " dim(s):" << dims_str << endl;
969
970 cout << " data type: " << GetDataTypeStr(shape->GetDataType()) << endl;
971 cout << " data format: " << GetDataFormatStr(shape->GetDataFormat()) << endl;
972 cout << " byte(s) excluding padding: " << shape->CalcBytesExcludingPadding() << endl;
973
974 datatype_t saved_data_type = shape->GetDataType();
975 if (saved_data_type == DATATYPE_FLOAT16) {
976 saved_data_type = DATATYPE_FLOAT32;
977 }
978 cout << " saved data type: " << GetDataTypeStr(saved_data_type) << endl;
979 }
980
981 cout << "----------------------" << endl;
982}
983
984#ifdef PPLNN_ENABLE_KERNEL_PROFILING
985static void PrintProfilingStatistics(const ProfilingStatistics& stat, double run_dur, int32_t run_count) {

Callers 1

mainFunction · 0.70

Calls 5

ToStringFunction · 0.85
GetOutputTensorMethod · 0.80
GetOutputCountMethod · 0.45
GetNameMethod · 0.45
GetShapeMethod · 0.45

Tested by

no test coverage detected