• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1syntax = "proto3";
2
3package tensorflow;
4
5import "google/protobuf/wrappers.proto";
6
7option cc_enable_arenas = true;
8option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto";
9
10// A TensorBundle addition which saves extra information about the objects which
11// own variables, allowing for more robust checkpoint loading into modified
12// programs.
13
14message TrackableObjectGraph {
15  message TrackableObject {
16    message ObjectReference {
17      // An index into `TrackableObjectGraph.nodes`, indicating the object
18      // being referenced.
19      int32 node_id = 1;
20      // A user-provided name for the edge.
21      string local_name = 2;
22    }
23
24    message SerializedTensor {
25      // A name for the Tensor. Simple variables have only one
26      // `SerializedTensor` named "VARIABLE_VALUE" by convention. This value may
27      // be restored on object creation as an optimization.
28      string name = 1;
29      // The full name of the variable/tensor, if applicable. Used to allow
30      // name-based loading of checkpoints which were saved using an
31      // object-based API. Should match the checkpoint key which would have been
32      // assigned by tf.train.Saver.
33      string full_name = 2;
34      // The generated name of the Tensor in the checkpoint.
35      string checkpoint_key = 3;
36      // Deprecated bool field for optional restore. This field has never been
37      // set to True.
38      reserved "optional_restore";
39      reserved 4;
40    }
41
42    message SlotVariableReference {
43      // An index into `TrackableObjectGraph.nodes`, indicating the
44      // variable object this slot was created for.
45      int32 original_variable_node_id = 1;
46      // The name of the slot (e.g. "m"/"v").
47      string slot_name = 2;
48      // An index into `TrackableObjectGraph.nodes`, indicating the
49      // `Object` with the value of the slot variable.
50      int32 slot_variable_node_id = 3;
51    }
52
53    // Objects which this object depends on.
54    repeated ObjectReference children = 1;
55    // Serialized data specific to this object.
56    repeated SerializedTensor attributes = 2;
57    // Slot variables owned by this object.
58    repeated SlotVariableReference slot_variables = 3;
59
60    // The registered saver used to save this object. If this saver is not
61    // present when loading the checkpoint, then loading will fail.
62    RegisteredSaver registered_saver = 4;
63
64    // Whether this object has checkpoint values or descendants with checkpoint
65    // values. This is computed at save time to avoid traversing the entire
66    // object graph proto when restoring (which also has to traverse the live
67    // object graph).
68    google.protobuf.BoolValue has_checkpoint_values = 5;
69  }
70
71  repeated TrackableObject nodes = 1;
72}
73
74message RegisteredSaver {
75  // The name of the registered saver/restore function.
76  string name = 1;
77
78  // Unique auto-generated name of the object.
79  string object_name = 2;
80}
81