1syntax = "proto3"; 2 3package tensorflow; 4option cc_enable_arenas = true; 5option java_outer_classname = "AttrValueProtos"; 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/tensor.proto"; 10import "tensorflow/core/framework/tensor_shape.proto"; 11import "tensorflow/core/framework/types.proto"; 12 13// Protocol buffer representing the value for an attr used to configure an Op. 14// Comment indicates the corresponding attr type. Only the field matching the 15// attr type may be filled. 16message AttrValue { 17 // LINT.IfChange 18 message ListValue { 19 repeated bytes s = 2; // "list(string)" 20 repeated int64 i = 3 [packed = true]; // "list(int)" 21 repeated float f = 4 [packed = true]; // "list(float)" 22 repeated bool b = 5 [packed = true]; // "list(bool)" 23 repeated DataType type = 6 [packed = true]; // "list(type)" 24 repeated TensorShapeProto shape = 7; // "list(shape)" 25 repeated TensorProto tensor = 8; // "list(tensor)" 26 repeated NameAttrList func = 9; // "list(attr)" 27 } 28 // LINT.ThenChange(https://www.tensorflow.org/code/tensorflow/c/c_api.cc) 29 30 oneof value { 31 bytes s = 2; // "string" 32 int64 i = 3; // "int" 33 float f = 4; // "float" 34 bool b = 5; // "bool" 35 DataType type = 6; // "type" 36 TensorShapeProto shape = 7; // "shape" 37 TensorProto tensor = 8; // "tensor" 38 ListValue list = 1; // any "list(...)" 39 40 // "func" represents a function. func.name is a function's name or 41 // a primitive op's name. func.attr.first is the name of an attr 42 // defined for that function. func.attr.second is the value for 43 // that attr in the instantiation. 44 NameAttrList func = 10; 45 46 // This is a placeholder only used in nodes defined inside a 47 // function. It indicates the attr value will be supplied when 48 // the function is instantiated. For example, let us suppose a 49 // node "N" in function "FN". "N" has an attr "A" with value 50 // placeholder = "foo". When FN is instantiated with attr "foo" 51 // set to "bar", the instantiated node N's attr A will have been 52 // given the value "bar". 53 string placeholder = 9; 54 } 55} 56 57// A list of attr names and their values. The whole list is attached 58// with a string name. E.g., MatMul[T=float]. 59message NameAttrList { 60 string name = 1; 61 map<string, AttrValue> attr = 2; 62} 63