• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1syntax = "proto3";
2
3package tensorflow;
4
5import "tensorflow/core/framework/attr_value.proto";
6
7option cc_enable_arenas = true;
8option java_outer_classname = "NodeProto";
9option java_multiple_files = true;
10option java_package = "org.tensorflow.framework";
11option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/node_def_go_proto";
12
13message NodeDef {
14  // The name given to this operator. Used for naming inputs,
15  // logging, visualization, etc.  Unique within a single GraphDef.
16  // Must match the regexp "[A-Za-z0-9.][A-Za-z0-9_>./]*".
17  string name = 1;
18
19  // The operation name.  There may be custom parameters in attrs.
20  // Op names starting with an underscore are reserved for internal use.
21  string op = 2;
22
23  // Each input is "node:src_output" with "node" being a string name and
24  // "src_output" indicating which output tensor to use from "node". If
25  // "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
26  // may optionally be followed by control inputs that have the format
27  // "^node".
28  repeated string input = 3;
29
30  // A (possibly partial) specification for the device on which this
31  // node should be placed.
32  // The expected syntax for this string is as follows:
33  //
34  // DEVICE_SPEC ::= PARTIAL_SPEC
35  //
36  // PARTIAL_SPEC ::= ("/" CONSTRAINT) *
37  // CONSTRAINT ::= ("job:" JOB_NAME)
38  //              | ("replica:" [1-9][0-9]*)
39  //              | ("task:" [1-9][0-9]*)
40  //              | ("device:" [A-Za-z]* ":" ([1-9][0-9]* | "*") )
41  //
42  // Valid values for this string include:
43  // * "/job:worker/replica:0/task:1/device:GPU:3"  (full specification)
44  // * "/job:worker/device:GPU:3"                   (partial specification)
45  // * ""                                    (no specification)
46  //
47  // If the constraints do not resolve to a single device (or if this
48  // field is empty or not present), the runtime will attempt to
49  // choose a device automatically.
50  string device = 4;
51
52  // Operation-specific graph-construction-time configuration.
53  // Note that this should include all attrs defined in the
54  // corresponding OpDef, including those with a value matching
55  // the default -- this allows the default to change and makes
56  // NodeDefs easier to interpret on their own.  However, if
57  // an attr with a default is not specified in this list, the
58  // default will be used.
59  // The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
60  // one of the names from the corresponding OpDef's attr field).
61  // The values must have a type matching the corresponding OpDef
62  // attr's type field.
63  // TODO(josh11b): Add some examples here showing best practices.
64  map<string, AttrValue> attr = 5;
65
66  message ExperimentalDebugInfo {
67    // Opaque string inserted into error messages created by the runtime.
68    //
69    // This is intended to store the list of names of the nodes from the
70    // original graph that this node was derived. For example if this node, say
71    // C, was result of a fusion of 2 nodes A and B, then 'original_node' would
72    // be {A, B}. This information can be used to map errors originating at the
73    // current node to some top level source code.
74    repeated string original_node_names = 1;
75
76    // This is intended to store the list of names of the functions from the
77    // original graph that this node was derived. For example if this node, say
78    // C, was result of a fusion of node A in function FA and node B in function
79    // FB, then `original_funcs` would be {FA, FB}. If the node is in the top
80    // level graph, the `original_func` is empty. This information, with the
81    // `original_node_names` can be used to map errors originating at the
82    // current ndoe to some top level source code.
83    repeated string original_func_names = 2;
84  }
85
86  // This stores debug information associated with the node.
87  ExperimentalDebugInfo experimental_debug_info = 6;
88}
89