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