aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/framework/graph.proto
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/core/framework/graph.proto')
-rw-r--r--tensorflow/core/framework/graph.proto103
1 files changed, 103 insertions, 0 deletions
diff --git a/tensorflow/core/framework/graph.proto b/tensorflow/core/framework/graph.proto
new file mode 100644
index 0000000000..a9bc07e88c
--- /dev/null
+++ b/tensorflow/core/framework/graph.proto
@@ -0,0 +1,103 @@
+syntax = "proto3";
+
+package tensorflow;
+// option cc_enable_arenas = true;
+
+import "tensorflow/core/framework/attr_value.proto";
+import "tensorflow/core/framework/function.proto";
+
+// Represents the graph of operations
+// TODO(sanjay): Also want to put the following somewhere:
+// * random_seed
+// * replicas: Do we stamp them out in python itself?
+// * where to load parameters
+// * optimizer info? does it go with the parameter layers/ops?
+message GraphDef {
+ repeated NodeDef node = 1;
+
+ // EXPERIMENTAL. DO NOT USE OR DEPEND ON THIS YET.
+ //
+ // "library" provides user-defined functions.
+ //
+ // Naming:
+ // * library.function.name are in a flat namespace.
+ // NOTE: We may need to change it to be hierarchical to support
+ // different orgs. E.g.,
+ // { "/google/nn", { ... }},
+ // { "/google/vision", { ... }}
+ // { "/org_foo/module_bar", {...}}
+ // map<string, FunctionDefLib> named_lib;
+ // * If node[i].op is the name of one function in "library",
+ // node[i] is deemed as a function call. Otherwise, node[i].op
+ // must be a primitive operation supported by the runtime.
+ //
+ //
+ // Function call semantics:
+ //
+ // * The callee may start execution as soon as some of its inputs
+ // are ready. The caller may want to use Tuple() mechanism to
+ // ensure all inputs are ready in the same time.
+ //
+ // * The consumer of return values may start executing as soon as
+ // the return values the consumer depends on are ready. The
+ // consumer may want to use Tuple() mechanism to ensure the
+ // consumer does not start until all return values of the callee
+ // function are ready.
+ FunctionDefLibrary library = 2;
+};
+
+message NodeDef {
+ // The name given to this operator. Used for naming inputs,
+ // logging, visualization, etc. Unique within a single GraphDef.
+ // Must match the regexp "[A-Za-z0-9.][A-Za-z0-9_./]*".
+ string name = 1;
+
+ // The operation name. There may be custom parameters in attrs.
+ // Op names starting with an underscore are reserved for internal use.
+ string op = 2;
+
+ // Each input is "node:src_output" with "node" being a string name and
+ // "src_output" indicating which output tensor to use from "node". If
+ // "src_output" is 0 the ":0" suffix can be omitted. Regular inputs
+ // may optionally be followed by control inputs that have the format
+ // "^node".
+ repeated string input = 3;
+
+ // A (possibly partial) specification for the device on which this
+ // node should be placed.
+ // The expected syntax for this string is as follows:
+ //
+ // DEVICE_SPEC ::= COLOCATED_NODE | PARTIAL_SPEC
+ //
+ // COLOCATED_NODE ::= "@" NODE_NAME // See NodeDef.name above.
+ // PARTIAL_SPEC ::= ("/" CONSTRAINT) *
+ // CONSTRAINT ::= ("job:" JOB_NAME)
+ // | ("replica:" [1-9][0-9]*)
+ // | ("task:" [1-9][0-9]*)
+ // | ( ("gpu" | "cpu") ":" ([1-9][0-9]* | "*") )
+ //
+ // Valid values for this string include:
+ // * "@other/node" (colocate with "other/node")
+ // * "/job:worker/replica:0/task:1/gpu:3" (full specification)
+ // * "/job:worker/gpu:3" (partial specification)
+ // * "" (no specification)
+ //
+ // If the constraints do not resolve to a single device (or if this
+ // field is empty or not present), the runtime will attempt to
+ // choose a device automatically.
+ string device = 4;
+
+ // Operation-specific graph-construction-time configuration.
+ // Note that this should include all attrs defined in the
+ // corresponding OpDef, including those with a value matching
+ // the default -- this allows the default to change and makes
+ // NodeDefs easier to interpret on their own. However, if
+ // an attr with a default is not specified in this list, the
+ // default will be used.
+ // The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
+ // one of the names from the corresponding OpDef's attr field).
+ // The values must have a type matching the corresponding OpDef
+ // attr's type field.
+ // TODO(josh11b): Add some examples here showing best practices.
+ map<string, AttrValue> attr = 5;
+};