In TensorFlow 1 a program kept graph elements in named
collections. A collection
of protocol-buffer objects is written as bytes_list: each byte string is
one encoded message, and the file does not say which. TensorFlow knows from the
collection’s name, using the converter registered for it. The explorer reads these by
name, and only when the bytes read as a message. The schema for each is below; the
mapping is from TensorFlow’s Python sources, which were read from memory, not
re-checked for this page.
A collection of a name not listed here keeps its bytes.
Collection names
| Collection | Message |
|---|---|
variables, trainable_variables, local_variables, model_variables, moving_average_variables, metric_variables, global_step | VariableDef |
savers | SaverDef |
queue_runners | QueueRunnerDef |
cond_context | CondContextDef |
while_context | WhileContextDef |
VariableDef
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | variable_name | string | The variable tensor’s name. |
| 6 | initial_value_name | string | The tensor holding the starting value. |
| 2 | initializer_name | string | The op that initialises it. |
| 3 | snapshot_name | string | The snapshot tensor’s name. |
| 4 | save_slice_info_def | SaveSliceInfoDef | When it is a slice of a larger variable. |
| 5 | is_resource | bool | Whether it is a ResourceVariable. |
| 7 | trainable | bool | Whether it is trained. |
| 8 | synchronization | VariableSynchronization | When a distributed variable syncs. |
| 9 | aggregation | VariableAggregation | How it is aggregated. |
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | full_name | string | The full variable. |
| 2 | full_shape | repeated int64 | Its shape. |
| 3 | var_offset | repeated int64 | This slice’s offset. |
| 4 | var_shape | repeated int64 | This slice’s shape. |
QueueRunnerDef
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | queue_name | string | The queue. |
| 2 | enqueue_op_name | repeated string | The ops that add items. |
| 3 | close_op_name | string | The op that closes it. |
| 4 | cancel_op_name | string | The op that cancels it. |
| 5 | queue_closed_exception_types | repeated error.Code | Errors that mean the queue was closed safely, such as OUT_OF_RANGE (11) or CANCELLED (1). |
Control-flow contexts
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | context_name | string | The context’s name. |
| 2 | pred_name | string | The predicate tensor. |
| 3 | pivot_name | string | The pivot tensor. |
| 4 | branch | int32 | The branch: 0 or 1. |
| 5 | values_def | ValuesDef | Values inside and outside. |
| 6 | nested_contexts | repeated ControlFlowContextDef | Contexts inside this one. |
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | context_name | string | The context’s name. |
| 2 | parallel_iterations | int32 | How many iterations may run at once. |
| 3 | back_prop | bool | Whether gradients are enabled. |
| 4 | swap_memory | bool | Whether GPU memory may be swapped. |
| 5 | pivot_name | string | The pivot tensor. |
| 6 | pivot_for_pred_name | string | The pivot for the predicate. |
| 7 | pivot_for_body_name | string | The pivot for the body. |
| 8 | loop_exit_names | repeated string | The exit tensors. |
| 9 | values_def | ValuesDef | Values inside and outside. |
| 10 | loop_enter_names | repeated string | The enter tensors. |
| 11 | maximum_iterations_name | string | The maximum_iterations tensor, if any. |
| 12 | nested_contexts | repeated ControlFlowContextDef | Contexts inside this one. |
| Field | Name | Type |
|---|---|---|
| 1 | cond_ctxt | CondContextDef |
| 2 | while_ctxt | WhileContextDef |
| Field | Name | Type | Meaning |
|---|---|---|---|
| 1 | values | repeated string | Names of the values in the context. |
| 2 | external_values | map<string, string> | Values defined outside it. |