(runtime)
| 561 | return ret |
| 562 | |
| 563 | def PrintInputOutputInfo(runtime): |
| 564 | print("----- input info -----") |
| 565 | for i in range(runtime.GetInputCount()): |
| 566 | tensor = runtime.GetInputTensor(i) |
| 567 | shape = tensor.GetShape() |
| 568 | dims = shape.GetDims() |
| 569 | print("input[" + str(i) + "]:") |
| 570 | print(" name: " + tensor.GetName()) |
| 571 | print(" dim(s):" + Dims2Str(dims)) |
| 572 | print(" data type: " + pplcommon.GetDataTypeStr(shape.GetDataType())) |
| 573 | print(" data format: " + pplcommon.GetDataFormatStr(shape.GetDataFormat())) |
| 574 | print(" byte(s) excluding padding: " + str(CalcBytes(dims, pplcommon.GetSizeOfDataType(shape.GetDataType())))) |
| 575 | |
| 576 | print("----- output info -----") |
| 577 | for i in range(runtime.GetOutputCount()): |
| 578 | tensor = runtime.GetOutputTensor(i) |
| 579 | shape = tensor.GetShape() |
| 580 | dims = shape.GetDims() |
| 581 | print("output[" + str(i) + "]:") |
| 582 | print(" name: " + tensor.GetName()) |
| 583 | print(" dim(s):" + Dims2Str(dims)) |
| 584 | print(" data type: " + pplcommon.GetDataTypeStr(shape.GetDataType())) |
| 585 | print(" data format: " + pplcommon.GetDataFormatStr(shape.GetDataFormat())) |
| 586 | print(" byte(s) excluding padding: " + str(CalcBytes(dims, pplcommon.GetSizeOfDataType(shape.GetDataType())))) |
| 587 | |
| 588 | saved_data_type = shape.GetDataType() |
| 589 | if saved_data_type == pplcommon.DATATYPE_FLOAT16: # convert fp16 to fp32 when saving to file |
| 590 | saved_data_type = pplcommon.DATATYPE_FLOAT32 |
| 591 | print(" saved data type: " + pplcommon.GetDataTypeStr(saved_data_type)) |
| 592 | |
| 593 | print("----------------------") |
| 594 | |
| 595 | # ---------------------------------------------------------------------------- # |
| 596 |
no test coverage detected