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