MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / GetOperatorDetails

Function GetOperatorDetails

tensorflow/lite/profiling/profile_summarizer.cc:66–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66OperatorDetails 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
91tensorflow::StatSummarizerOptions GetProfileSummarizerOptions() {
92 auto options = tensorflow::StatSummarizerOptions();

Callers 1

ProcessProfilesMethod · 0.85

Calls 4

EnumNamesBuiltinOperatorFunction · 0.85
GetTensorNamesFunction · 0.85
OpProfilingStringMethod · 0.80
node_and_registrationMethod · 0.45

Tested by

no test coverage detected