A GraphDef can carry the source
locations of its nodes for error messages, in debug_info, and
NodeDefs and op arguments can carry a
full type. The schemas are graph_debug_info.proto and
full_type.proto in TensorFlow’s core/framework.
GraphDebugInfo
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | files | repeated string | Source file names. |
| 4 | frames_by_id | map<fixed64, FileLineCol> | Each frame’s unique ID and location. |
| 6 | traces_by_id | map<fixed64, StackTrace> | Each trace’s unique ID and stack. |
| 2 | traces | map<string, StackTrace> | Deprecated: traces by name. |
| 5 | name_to_trace_id | map<string, fixed64> | From a name such as op.name@func_name to a trace ID. |
The map fields are entries with a key and value, as usual for maps. The fixed-64-bit keys are stored with wire type I64; the deprecated form keeps stacks inline.
GraphDebugInfo.FileLineCol
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | file_index | int32 | Index into files. |
| 2 | line | int32 | Line number. |
| 3 | col | int32 | Column number. |
| 4 | func | string | The enclosing function. |
| 5 | code | string | The line of source. |
GraphDebugInfo.StackTrace
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | file_line_cols | repeated FileLineCol | Deprecated: the locations themselves. |
| 2 | frame_id | repeated fixed64, packed | The frames, as IDs into frames_by_id. |
FullTypeDef
A type that TensorFlow’s type inference can check. A full type is a type ID, a list of
parameters, which are full types too, and a name or a number. The explorer shows it
as a type expression, such as TENSOR[FLOAT]. It appears as
experimental_type
on a NodeDef and experimental_full_type on an op argument.
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | type_id | FullTypeId | The kind of type. |
| 2 | args | repeated FullTypeDef | The type’s parameters. |
| 3 | s | string | A string attribute (oneof attr), such as a type variable’s name. |
| 4 | i | int64 | An integer attribute (oneof attr), such as a static shape value. |
FullTypeId
| Value | Name | Meaning |
|---|---|---|
| 0 | TFT_UNSET | The default for values not set. |
| 1 | TFT_VAR | A placeholder for any type ID in templates. |
| 2 | TFT_ANY | A wildcard for a parameter of unknown type. |
| 3 | TFT_PRODUCT | A logical grouping of several types. |
| 4 | TFT_NAMED | A named field; the name is in the attribute. |
| 20 | TFT_FOR_EACH | Expands a template over variables. |
| 100 | TFT_CALLABLE | A function or op with argument and return types. |
| 200 | TFT_BOOL | Bool elements. |
| 201 | TFT_UINT8 | Unsigned 8-bit integers. |
| 202 | TFT_UINT16 | Unsigned 16-bit integers. |
| 203 | TFT_UINT32 | Unsigned 32-bit integers. |
| 204 | TFT_UINT64 | Unsigned 64-bit integers. |
| 205 | TFT_INT8 | Signed 8-bit integers. |
| 206 | TFT_INT16 | Signed 16-bit integers. |
| 207 | TFT_INT32 | Signed 32-bit integers. |
| 208 | TFT_INT64 | Signed 64-bit integers. |
| 209 | TFT_HALF | 16-bit floats. |
| 210 | TFT_FLOAT | 32-bit floats. |
| 211 | TFT_DOUBLE | 64-bit floats. |
| 212 | TFT_COMPLEX64 | 64-bit complex numbers. |
| 213 | TFT_COMPLEX128 | 128-bit complex numbers. |
| 214 | TFT_STRING | Strings. |
| 215 | TFT_BFLOAT16 | bfloat16 elements. |
| 1000 | TFT_TENSOR | A tensor with an element type (the shape is not yet defined here). |
| 1001 | TFT_ARRAY | A random-access list of one element type. |
| 1002 | TFT_OPTIONAL | A value holding one element or nothing. |
| 1003 | TFT_LITERAL | A compile-time constant. |
| 1004 | TFT_ENCODED | A value of one type encoded as another. |
| 1005 | TFT_SHAPE_TENSOR | A host-only tensor holding other tensors’ shapes. |
| 10102 | TFT_DATASET | A tf.data dataset producing elements of one type. |
| 10103 | TFT_RAGGED | A ragged tensor. |
| 10104 | TFT_ITERATOR | A mutable tf.data iterator. |
| 10202 | TFT_MUTEX_LOCK | A mutex lock tensor. |
| 10203 | TFT_LEGACY_VARIANT | The equivalent of a DT_VARIANT tensor. |