| 64 | } |
| 65 | |
| 66 | OperatorDetails GetOperatorDetails(const tflite::Interpreter& interpreter, |
| 67 | int node_index) { |
| 68 | auto node_reg = interpreter.node_and_registration(node_index); |
| 69 | auto inputs = node_reg->first.inputs; |
| 70 | auto outputs = node_reg->first.outputs; |
| 71 | int code = node_reg->second.builtin_code; |
| 72 | const char* op_name = nullptr; |
| 73 | if (code == tflite::BuiltinOperator_CUSTOM) { |
| 74 | const char* custom_name = node_reg->second.custom_name; |
| 75 | op_name = custom_name ? custom_name : "UnknownCustomOp"; |
| 76 | } else { |
| 77 | op_name = tflite::EnumNamesBuiltinOperator()[code]; |
| 78 | } |
| 79 | const char* profiling_string = |
| 80 | interpreter.OpProfilingString(node_reg->second, &node_reg->first); |
| 81 | OperatorDetails details; |
| 82 | details.name = op_name; |
| 83 | if (profiling_string) { |
| 84 | details.name += ":" + std::string(profiling_string); |
| 85 | } |
| 86 | details.inputs = GetTensorNames(interpreter, inputs); |
| 87 | details.outputs = GetTensorNames(interpreter, outputs); |
| 88 | return details; |
| 89 | } |
| 90 | |
| 91 | tensorflow::StatSummarizerOptions GetProfileSummarizerOptions() { |
| 92 | auto options = tensorflow::StatSummarizerOptions(); |
no test coverage detected