This CL added the debug information support for the nodes in the frozen graphs which are GraphDefs and will be sent to the new tf-tflite converter. A GraphDef only serializes the node name from the original Graph object, but the whole stack track defining the node will miss. So to collect the stack trace (debug information) for the nodes in the GraphDef, a few changes made in this CL: - For TFLiteConverter (v1), an experimental function, which create Graph Debug info from the original graph object, is passed to the converter constructor in addition to the GraphDef, so we can retrive the stack trace for the nodes from the GraphDef. (TFLiteConverterV2 isn't an issue because function object has passed to the constructor.) - Propagate the original node name in the Grappler function inlining pass, so the original node name is stored in the GraphDef when a node is inlined. And we can use the stored name to look up the stack trace in the original graph. - When a node name is looked up in the original graph, We need to consider the function library as well. For function libraries created by `@tf.function` and `@defun`, we use the sub-graphs in the original graph. However, function created by `@Defun` only has FunctionDef for the sub-graphs, so it isn't supported by this CL. PiperOrigin-RevId: 253932770
79 lines
1.5 KiB
Plaintext
79 lines
1.5 KiB
Plaintext
path: "tensorflow.NodeDef"
|
|
tf_proto {
|
|
descriptor {
|
|
name: "NodeDef"
|
|
field {
|
|
name: "name"
|
|
number: 1
|
|
label: LABEL_OPTIONAL
|
|
type: TYPE_STRING
|
|
}
|
|
field {
|
|
name: "op"
|
|
number: 2
|
|
label: LABEL_OPTIONAL
|
|
type: TYPE_STRING
|
|
}
|
|
field {
|
|
name: "input"
|
|
number: 3
|
|
label: LABEL_REPEATED
|
|
type: TYPE_STRING
|
|
}
|
|
field {
|
|
name: "device"
|
|
number: 4
|
|
label: LABEL_OPTIONAL
|
|
type: TYPE_STRING
|
|
}
|
|
field {
|
|
name: "attr"
|
|
number: 5
|
|
label: LABEL_REPEATED
|
|
type: TYPE_MESSAGE
|
|
type_name: ".tensorflow.NodeDef.AttrEntry"
|
|
}
|
|
field {
|
|
name: "experimental_debug_info"
|
|
number: 6
|
|
label: LABEL_OPTIONAL
|
|
type: TYPE_MESSAGE
|
|
type_name: ".tensorflow.NodeDef.ExperimentalDebugInfo"
|
|
}
|
|
nested_type {
|
|
name: "AttrEntry"
|
|
field {
|
|
name: "key"
|
|
number: 1
|
|
label: LABEL_OPTIONAL
|
|
type: TYPE_STRING
|
|
}
|
|
field {
|
|
name: "value"
|
|
number: 2
|
|
label: LABEL_OPTIONAL
|
|
type: TYPE_MESSAGE
|
|
type_name: ".tensorflow.AttrValue"
|
|
}
|
|
options {
|
|
map_entry: true
|
|
}
|
|
}
|
|
nested_type {
|
|
name: "ExperimentalDebugInfo"
|
|
field {
|
|
name: "original_node_names"
|
|
number: 1
|
|
label: LABEL_REPEATED
|
|
type: TYPE_STRING
|
|
}
|
|
field {
|
|
name: "original_func_names"
|
|
number: 2
|
|
label: LABEL_REPEATED
|
|
type: TYPE_STRING
|
|
}
|
|
}
|
|
}
|
|
}
|