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