├── .gitignore ├── README.md ├── config ├── allocation_description.pb.go ├── attr_value.pb.go ├── config.go ├── config.pb.go ├── cost_graph.pb.go ├── device_attributes.pb.go ├── function.pb.go ├── graph.pb.go ├── kernel_def.pb.go ├── log_memory.pb.go ├── op_def.pb.go ├── step_stats.pb.go ├── summary.pb.go ├── tensor.pb.go ├── tensor_description.pb.go ├── tensor_shape.pb.go ├── tensor_slice.pb.go ├── types.pb.go ├── variable.pb.go └── versions.pb.go ├── generate.sh ├── generic_tensor.go ├── graph.go ├── tensor.go ├── tensor_float32.go ├── tensor_int32.go ├── tensorflow.c ├── tensorflow.go ├── tensorflow.h └── tensorflow_test.go /.gitignore: -------------------------------------------------------------------------------- 1 | .* 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Purpose 2 | 3 | This binding was created to use Tensorflow in some existing Go projects that I 4 | have/had. For this reason it only provides the functionality that I need(ed). 5 | There are currently Go bindings brewing in upstream: 6 | 7 | * Source: https://github.com/tensorflow/tensorflow/tree/master/tensorflow/go 8 | * Issue: https://github.com/tensorflow/tensorflow/issues/10#issuecomment-245687757 9 | 10 | Once they are done, it's better the use the upstream binding, since it is always 11 | in sync with the latest Tensorflow. 12 | 13 | # Building 14 | 15 | Get v0.8.0 of Tensorflow and build it: 16 | 17 | ~~~{.bash} 18 | $ git clone https://github.com/tensorflow/tensorflow.git 19 | $ cd tensorflow 20 | $ git checkout v0.8.0 21 | $ git submodule init 22 | $ git submodule update 23 | $ ./configure 24 | $ bazel build -c opt tensorflow:libtensorflow.so 25 | ~~~ 26 | 27 | Now you need to put `tensor_c_api.h` and `libtensorflow.so` visible somewhere for cgo 28 | and your C compiler. On OS X using Homebrew: 29 | 30 | ~~~{.bash} 31 | $ mkdir -p /usr/local/Cellar/tensorflow/0.8.0/{lib,include} 32 | $ cp bazel-bin/tensorflow/libtensorflow.so /usr/local/Cellar/tensorflow/0.8.0/lib 33 | $ cp tensorflow/core/public/tensor_c_api.h /usr/local/Cellar/tensorflow/0.8.0/include 34 | $ brew link tensorflow 35 | ~~~ 36 | 37 | Now you can build the Go package as normal. 38 | -------------------------------------------------------------------------------- /config/allocation_description.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. 2 | // source: tensorflow/core/framework/allocation_description.proto 3 | // DO NOT EDIT! 4 | 5 | package config 6 | 7 | import proto "github.com/golang/protobuf/proto" 8 | import fmt "fmt" 9 | import math "math" 10 | 11 | // Reference imports to suppress errors if they are not otherwise used. 12 | var _ = proto.Marshal 13 | var _ = fmt.Errorf 14 | var _ = math.Inf 15 | 16 | type AllocationDescription struct { 17 | // Total number of bytes requested 18 | RequestedBytes int64 `protobuf:"varint,1,opt,name=requested_bytes,json=requestedBytes" json:"requested_bytes,omitempty"` 19 | // Total number of bytes allocated if known 20 | AllocatedBytes int64 `protobuf:"varint,2,opt,name=allocated_bytes,json=allocatedBytes" json:"allocated_bytes,omitempty"` 21 | // Name of the allocator used 22 | AllocatorName string `protobuf:"bytes,3,opt,name=allocator_name,json=allocatorName" json:"allocator_name,omitempty"` 23 | // Identifier of the allocated buffer if known 24 | AllocationId int64 `protobuf:"varint,4,opt,name=allocation_id,json=allocationId" json:"allocation_id,omitempty"` 25 | // Set if this tensor only has one remaining reference 26 | HasSingleReference bool `protobuf:"varint,5,opt,name=has_single_reference,json=hasSingleReference" json:"has_single_reference,omitempty"` 27 | // Address of the allocation. 28 | Ptr uint64 `protobuf:"varint,6,opt,name=ptr" json:"ptr,omitempty"` 29 | } 30 | 31 | func (m *AllocationDescription) Reset() { *m = AllocationDescription{} } 32 | func (m *AllocationDescription) String() string { return proto.CompactTextString(m) } 33 | func (*AllocationDescription) ProtoMessage() {} 34 | func (*AllocationDescription) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } 35 | 36 | func init() { 37 | proto.RegisterType((*AllocationDescription)(nil), "tensorflow.AllocationDescription") 38 | } 39 | 40 | func init() { 41 | proto.RegisterFile("tensorflow/core/framework/allocation_description.proto", fileDescriptor1) 42 | } 43 | 44 | var fileDescriptor1 = []byte{ 45 | // 258 bytes of a gzipped FileDescriptorProto 46 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x6c, 0x90, 0xcf, 0x4b, 0xc3, 0x30, 47 | 0x14, 0x80, 0x89, 0x9b, 0x43, 0x83, 0x53, 0x09, 0x0a, 0x01, 0x2f, 0x45, 0x11, 0x7b, 0x6a, 0x05, 48 | 0xc1, 0x93, 0x17, 0x8b, 0x17, 0x2f, 0x32, 0xe2, 0x1f, 0x10, 0xb2, 0xf6, 0x75, 0x2b, 0xb6, 0x79, 49 | 0xf5, 0x25, 0x32, 0xfc, 0xcf, 0xf5, 0x26, 0xe9, 0x5c, 0xea, 0xc1, 0xdb, 0xe3, 0x7b, 0x5f, 0x7e, 50 | 0xf0, 0xf1, 0x7b, 0x0f, 0xd6, 0x21, 0xd5, 0x2d, 0x6e, 0xf2, 0x12, 0x09, 0xf2, 0x9a, 0x4c, 0x07, 51 | 0x1b, 0xa4, 0xb7, 0xdc, 0xb4, 0x2d, 0x96, 0xc6, 0x37, 0x68, 0x75, 0x05, 0xae, 0xa4, 0xa6, 0x0f, 52 | 0x73, 0xd6, 0x13, 0x7a, 0x14, 0x7c, 0x3c, 0x77, 0xf9, 0xcd, 0xf8, 0xf9, 0x63, 0x94, 0x9f, 0x46, 53 | 0x57, 0xdc, 0xf0, 0x13, 0x82, 0xf7, 0x0f, 0x70, 0x1e, 0x2a, 0xbd, 0xfc, 0xf4, 0xe0, 0x24, 0x4b, 54 | 0x58, 0x3a, 0x51, 0xc7, 0x11, 0x17, 0x81, 0x06, 0xf1, 0xf7, 0xb9, 0x28, 0xee, 0x6d, 0xc5, 0x88, 55 | 0xb7, 0xe2, 0x35, 0xdf, 0x11, 0x24, 0x6d, 0x4d, 0x07, 0x72, 0x92, 0xb0, 0xf4, 0x50, 0xcd, 0x23, 56 | 0x7d, 0x31, 0x1d, 0x88, 0x2b, 0x3e, 0xff, 0xf3, 0xfd, 0xa6, 0x92, 0xd3, 0xe1, 0xb6, 0xa3, 0x11, 57 | 0x3e, 0x57, 0xe2, 0x96, 0x9f, 0xad, 0x8d, 0xd3, 0xae, 0xb1, 0xab, 0x16, 0x34, 0x41, 0x0d, 0x04, 58 | 0xb6, 0x04, 0xb9, 0x9f, 0xb0, 0xf4, 0x40, 0x89, 0xb5, 0x71, 0xaf, 0xc3, 0x4a, 0xed, 0x36, 0xe2, 59 | 0x94, 0x4f, 0x7a, 0x4f, 0x72, 0x96, 0xb0, 0x74, 0xaa, 0xc2, 0x58, 0x3c, 0x70, 0x89, 0xb4, 0xca, 60 | 0xc6, 0x1a, 0x59, 0x0c, 0x58, 0x5c, 0xfc, 0x1b, 0x65, 0x11, 0xfa, 0xb9, 0x05, 0xfb, 0x62, 0x6c, 61 | 0x39, 0x1b, 0x62, 0xde, 0xfd, 0x04, 0x00, 0x00, 0xff, 0xff, 0x2e, 0xb7, 0xe1, 0x85, 0x86, 0x01, 62 | 0x00, 0x00, 63 | } 64 | -------------------------------------------------------------------------------- /config/attr_value.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. 2 | // source: tensorflow/core/framework/attr_value.proto 3 | // DO NOT EDIT! 4 | 5 | package config 6 | 7 | import proto "github.com/golang/protobuf/proto" 8 | import fmt "fmt" 9 | import math "math" 10 | 11 | // Reference imports to suppress errors if they are not otherwise used. 12 | var _ = proto.Marshal 13 | var _ = fmt.Errorf 14 | var _ = math.Inf 15 | 16 | // Protocol buffer representing the value for an attr used to configure an Op. 17 | // Comment indicates the corresponding attr type. Only the field matching the 18 | // attr type may be filled. 19 | type AttrValue struct { 20 | // Types that are valid to be assigned to Value: 21 | // *AttrValue_S 22 | // *AttrValue_I 23 | // *AttrValue_F 24 | // *AttrValue_B 25 | // *AttrValue_Type 26 | // *AttrValue_Shape 27 | // *AttrValue_Tensor 28 | // *AttrValue_List 29 | // *AttrValue_Func 30 | // *AttrValue_Placeholder 31 | Value isAttrValue_Value `protobuf_oneof:"value"` 32 | } 33 | 34 | func (m *AttrValue) Reset() { *m = AttrValue{} } 35 | func (m *AttrValue) String() string { return proto.CompactTextString(m) } 36 | func (*AttrValue) ProtoMessage() {} 37 | func (*AttrValue) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } 38 | 39 | type isAttrValue_Value interface { 40 | isAttrValue_Value() 41 | } 42 | 43 | type AttrValue_S struct { 44 | S []byte `protobuf:"bytes,2,opt,name=s,proto3,oneof"` 45 | } 46 | type AttrValue_I struct { 47 | I int64 `protobuf:"varint,3,opt,name=i,oneof"` 48 | } 49 | type AttrValue_F struct { 50 | F float32 `protobuf:"fixed32,4,opt,name=f,oneof"` 51 | } 52 | type AttrValue_B struct { 53 | B bool `protobuf:"varint,5,opt,name=b,oneof"` 54 | } 55 | type AttrValue_Type struct { 56 | Type DataType `protobuf:"varint,6,opt,name=type,enum=tensorflow.DataType,oneof"` 57 | } 58 | type AttrValue_Shape struct { 59 | Shape *TensorShapeProto `protobuf:"bytes,7,opt,name=shape,oneof"` 60 | } 61 | type AttrValue_Tensor struct { 62 | Tensor *TensorProto `protobuf:"bytes,8,opt,name=tensor,oneof"` 63 | } 64 | type AttrValue_List struct { 65 | List *AttrValue_ListValue `protobuf:"bytes,1,opt,name=list,oneof"` 66 | } 67 | type AttrValue_Func struct { 68 | Func *NameAttrList `protobuf:"bytes,10,opt,name=func,oneof"` 69 | } 70 | type AttrValue_Placeholder struct { 71 | Placeholder string `protobuf:"bytes,9,opt,name=placeholder,oneof"` 72 | } 73 | 74 | func (*AttrValue_S) isAttrValue_Value() {} 75 | func (*AttrValue_I) isAttrValue_Value() {} 76 | func (*AttrValue_F) isAttrValue_Value() {} 77 | func (*AttrValue_B) isAttrValue_Value() {} 78 | func (*AttrValue_Type) isAttrValue_Value() {} 79 | func (*AttrValue_Shape) isAttrValue_Value() {} 80 | func (*AttrValue_Tensor) isAttrValue_Value() {} 81 | func (*AttrValue_List) isAttrValue_Value() {} 82 | func (*AttrValue_Func) isAttrValue_Value() {} 83 | func (*AttrValue_Placeholder) isAttrValue_Value() {} 84 | 85 | func (m *AttrValue) GetValue() isAttrValue_Value { 86 | if m != nil { 87 | return m.Value 88 | } 89 | return nil 90 | } 91 | 92 | func (m *AttrValue) GetS() []byte { 93 | if x, ok := m.GetValue().(*AttrValue_S); ok { 94 | return x.S 95 | } 96 | return nil 97 | } 98 | 99 | func (m *AttrValue) GetI() int64 { 100 | if x, ok := m.GetValue().(*AttrValue_I); ok { 101 | return x.I 102 | } 103 | return 0 104 | } 105 | 106 | func (m *AttrValue) GetF() float32 { 107 | if x, ok := m.GetValue().(*AttrValue_F); ok { 108 | return x.F 109 | } 110 | return 0 111 | } 112 | 113 | func (m *AttrValue) GetB() bool { 114 | if x, ok := m.GetValue().(*AttrValue_B); ok { 115 | return x.B 116 | } 117 | return false 118 | } 119 | 120 | func (m *AttrValue) GetType() DataType { 121 | if x, ok := m.GetValue().(*AttrValue_Type); ok { 122 | return x.Type 123 | } 124 | return DataType_DT_INVALID 125 | } 126 | 127 | func (m *AttrValue) GetShape() *TensorShapeProto { 128 | if x, ok := m.GetValue().(*AttrValue_Shape); ok { 129 | return x.Shape 130 | } 131 | return nil 132 | } 133 | 134 | func (m *AttrValue) GetTensor() *TensorProto { 135 | if x, ok := m.GetValue().(*AttrValue_Tensor); ok { 136 | return x.Tensor 137 | } 138 | return nil 139 | } 140 | 141 | func (m *AttrValue) GetList() *AttrValue_ListValue { 142 | if x, ok := m.GetValue().(*AttrValue_List); ok { 143 | return x.List 144 | } 145 | return nil 146 | } 147 | 148 | func (m *AttrValue) GetFunc() *NameAttrList { 149 | if x, ok := m.GetValue().(*AttrValue_Func); ok { 150 | return x.Func 151 | } 152 | return nil 153 | } 154 | 155 | func (m *AttrValue) GetPlaceholder() string { 156 | if x, ok := m.GetValue().(*AttrValue_Placeholder); ok { 157 | return x.Placeholder 158 | } 159 | return "" 160 | } 161 | 162 | // XXX_OneofFuncs is for the internal use of the proto package. 163 | func (*AttrValue) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { 164 | return _AttrValue_OneofMarshaler, _AttrValue_OneofUnmarshaler, _AttrValue_OneofSizer, []interface{}{ 165 | (*AttrValue_S)(nil), 166 | (*AttrValue_I)(nil), 167 | (*AttrValue_F)(nil), 168 | (*AttrValue_B)(nil), 169 | (*AttrValue_Type)(nil), 170 | (*AttrValue_Shape)(nil), 171 | (*AttrValue_Tensor)(nil), 172 | (*AttrValue_List)(nil), 173 | (*AttrValue_Func)(nil), 174 | (*AttrValue_Placeholder)(nil), 175 | } 176 | } 177 | 178 | func _AttrValue_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { 179 | m := msg.(*AttrValue) 180 | // value 181 | switch x := m.Value.(type) { 182 | case *AttrValue_S: 183 | b.EncodeVarint(2<<3 | proto.WireBytes) 184 | b.EncodeRawBytes(x.S) 185 | case *AttrValue_I: 186 | b.EncodeVarint(3<<3 | proto.WireVarint) 187 | b.EncodeVarint(uint64(x.I)) 188 | case *AttrValue_F: 189 | b.EncodeVarint(4<<3 | proto.WireFixed32) 190 | b.EncodeFixed32(uint64(math.Float32bits(x.F))) 191 | case *AttrValue_B: 192 | t := uint64(0) 193 | if x.B { 194 | t = 1 195 | } 196 | b.EncodeVarint(5<<3 | proto.WireVarint) 197 | b.EncodeVarint(t) 198 | case *AttrValue_Type: 199 | b.EncodeVarint(6<<3 | proto.WireVarint) 200 | b.EncodeVarint(uint64(x.Type)) 201 | case *AttrValue_Shape: 202 | b.EncodeVarint(7<<3 | proto.WireBytes) 203 | if err := b.EncodeMessage(x.Shape); err != nil { 204 | return err 205 | } 206 | case *AttrValue_Tensor: 207 | b.EncodeVarint(8<<3 | proto.WireBytes) 208 | if err := b.EncodeMessage(x.Tensor); err != nil { 209 | return err 210 | } 211 | case *AttrValue_List: 212 | b.EncodeVarint(1<<3 | proto.WireBytes) 213 | if err := b.EncodeMessage(x.List); err != nil { 214 | return err 215 | } 216 | case *AttrValue_Func: 217 | b.EncodeVarint(10<<3 | proto.WireBytes) 218 | if err := b.EncodeMessage(x.Func); err != nil { 219 | return err 220 | } 221 | case *AttrValue_Placeholder: 222 | b.EncodeVarint(9<<3 | proto.WireBytes) 223 | b.EncodeStringBytes(x.Placeholder) 224 | case nil: 225 | default: 226 | return fmt.Errorf("AttrValue.Value has unexpected type %T", x) 227 | } 228 | return nil 229 | } 230 | 231 | func _AttrValue_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { 232 | m := msg.(*AttrValue) 233 | switch tag { 234 | case 2: // value.s 235 | if wire != proto.WireBytes { 236 | return true, proto.ErrInternalBadWireType 237 | } 238 | x, err := b.DecodeRawBytes(true) 239 | m.Value = &AttrValue_S{x} 240 | return true, err 241 | case 3: // value.i 242 | if wire != proto.WireVarint { 243 | return true, proto.ErrInternalBadWireType 244 | } 245 | x, err := b.DecodeVarint() 246 | m.Value = &AttrValue_I{int64(x)} 247 | return true, err 248 | case 4: // value.f 249 | if wire != proto.WireFixed32 { 250 | return true, proto.ErrInternalBadWireType 251 | } 252 | x, err := b.DecodeFixed32() 253 | m.Value = &AttrValue_F{math.Float32frombits(uint32(x))} 254 | return true, err 255 | case 5: // value.b 256 | if wire != proto.WireVarint { 257 | return true, proto.ErrInternalBadWireType 258 | } 259 | x, err := b.DecodeVarint() 260 | m.Value = &AttrValue_B{x != 0} 261 | return true, err 262 | case 6: // value.type 263 | if wire != proto.WireVarint { 264 | return true, proto.ErrInternalBadWireType 265 | } 266 | x, err := b.DecodeVarint() 267 | m.Value = &AttrValue_Type{DataType(x)} 268 | return true, err 269 | case 7: // value.shape 270 | if wire != proto.WireBytes { 271 | return true, proto.ErrInternalBadWireType 272 | } 273 | msg := new(TensorShapeProto) 274 | err := b.DecodeMessage(msg) 275 | m.Value = &AttrValue_Shape{msg} 276 | return true, err 277 | case 8: // value.tensor 278 | if wire != proto.WireBytes { 279 | return true, proto.ErrInternalBadWireType 280 | } 281 | msg := new(TensorProto) 282 | err := b.DecodeMessage(msg) 283 | m.Value = &AttrValue_Tensor{msg} 284 | return true, err 285 | case 1: // value.list 286 | if wire != proto.WireBytes { 287 | return true, proto.ErrInternalBadWireType 288 | } 289 | msg := new(AttrValue_ListValue) 290 | err := b.DecodeMessage(msg) 291 | m.Value = &AttrValue_List{msg} 292 | return true, err 293 | case 10: // value.func 294 | if wire != proto.WireBytes { 295 | return true, proto.ErrInternalBadWireType 296 | } 297 | msg := new(NameAttrList) 298 | err := b.DecodeMessage(msg) 299 | m.Value = &AttrValue_Func{msg} 300 | return true, err 301 | case 9: // value.placeholder 302 | if wire != proto.WireBytes { 303 | return true, proto.ErrInternalBadWireType 304 | } 305 | x, err := b.DecodeStringBytes() 306 | m.Value = &AttrValue_Placeholder{x} 307 | return true, err 308 | default: 309 | return false, nil 310 | } 311 | } 312 | 313 | func _AttrValue_OneofSizer(msg proto.Message) (n int) { 314 | m := msg.(*AttrValue) 315 | // value 316 | switch x := m.Value.(type) { 317 | case *AttrValue_S: 318 | n += proto.SizeVarint(2<<3 | proto.WireBytes) 319 | n += proto.SizeVarint(uint64(len(x.S))) 320 | n += len(x.S) 321 | case *AttrValue_I: 322 | n += proto.SizeVarint(3<<3 | proto.WireVarint) 323 | n += proto.SizeVarint(uint64(x.I)) 324 | case *AttrValue_F: 325 | n += proto.SizeVarint(4<<3 | proto.WireFixed32) 326 | n += 4 327 | case *AttrValue_B: 328 | n += proto.SizeVarint(5<<3 | proto.WireVarint) 329 | n += 1 330 | case *AttrValue_Type: 331 | n += proto.SizeVarint(6<<3 | proto.WireVarint) 332 | n += proto.SizeVarint(uint64(x.Type)) 333 | case *AttrValue_Shape: 334 | s := proto.Size(x.Shape) 335 | n += proto.SizeVarint(7<<3 | proto.WireBytes) 336 | n += proto.SizeVarint(uint64(s)) 337 | n += s 338 | case *AttrValue_Tensor: 339 | s := proto.Size(x.Tensor) 340 | n += proto.SizeVarint(8<<3 | proto.WireBytes) 341 | n += proto.SizeVarint(uint64(s)) 342 | n += s 343 | case *AttrValue_List: 344 | s := proto.Size(x.List) 345 | n += proto.SizeVarint(1<<3 | proto.WireBytes) 346 | n += proto.SizeVarint(uint64(s)) 347 | n += s 348 | case *AttrValue_Func: 349 | s := proto.Size(x.Func) 350 | n += proto.SizeVarint(10<<3 | proto.WireBytes) 351 | n += proto.SizeVarint(uint64(s)) 352 | n += s 353 | case *AttrValue_Placeholder: 354 | n += proto.SizeVarint(9<<3 | proto.WireBytes) 355 | n += proto.SizeVarint(uint64(len(x.Placeholder))) 356 | n += len(x.Placeholder) 357 | case nil: 358 | default: 359 | panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) 360 | } 361 | return n 362 | } 363 | 364 | type AttrValue_ListValue struct { 365 | S [][]byte `protobuf:"bytes,2,rep,name=s,proto3" json:"s,omitempty"` 366 | I []int64 `protobuf:"varint,3,rep,packed,name=i" json:"i,omitempty"` 367 | F []float32 `protobuf:"fixed32,4,rep,packed,name=f" json:"f,omitempty"` 368 | B []bool `protobuf:"varint,5,rep,packed,name=b" json:"b,omitempty"` 369 | Type []DataType `protobuf:"varint,6,rep,packed,name=type,enum=tensorflow.DataType" json:"type,omitempty"` 370 | Shape []*TensorShapeProto `protobuf:"bytes,7,rep,name=shape" json:"shape,omitempty"` 371 | Tensor []*TensorProto `protobuf:"bytes,8,rep,name=tensor" json:"tensor,omitempty"` 372 | } 373 | 374 | func (m *AttrValue_ListValue) Reset() { *m = AttrValue_ListValue{} } 375 | func (m *AttrValue_ListValue) String() string { return proto.CompactTextString(m) } 376 | func (*AttrValue_ListValue) ProtoMessage() {} 377 | func (*AttrValue_ListValue) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0, 0} } 378 | 379 | func (m *AttrValue_ListValue) GetShape() []*TensorShapeProto { 380 | if m != nil { 381 | return m.Shape 382 | } 383 | return nil 384 | } 385 | 386 | func (m *AttrValue_ListValue) GetTensor() []*TensorProto { 387 | if m != nil { 388 | return m.Tensor 389 | } 390 | return nil 391 | } 392 | 393 | // A list of attr names and their values. The whole list is attached 394 | // with a string name. E.g., MatMul[T=float]. 395 | type NameAttrList struct { 396 | Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` 397 | Attr map[string]*AttrValue `protobuf:"bytes,2,rep,name=attr" json:"attr,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` 398 | } 399 | 400 | func (m *NameAttrList) Reset() { *m = NameAttrList{} } 401 | func (m *NameAttrList) String() string { return proto.CompactTextString(m) } 402 | func (*NameAttrList) ProtoMessage() {} 403 | func (*NameAttrList) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1} } 404 | 405 | func (m *NameAttrList) GetAttr() map[string]*AttrValue { 406 | if m != nil { 407 | return m.Attr 408 | } 409 | return nil 410 | } 411 | 412 | func init() { 413 | proto.RegisterType((*AttrValue)(nil), "tensorflow.AttrValue") 414 | proto.RegisterType((*AttrValue_ListValue)(nil), "tensorflow.AttrValue.ListValue") 415 | proto.RegisterType((*NameAttrList)(nil), "tensorflow.NameAttrList") 416 | } 417 | 418 | func init() { proto.RegisterFile("tensorflow/core/framework/attr_value.proto", fileDescriptor2) } 419 | 420 | var fileDescriptor2 = []byte{ 421 | // 488 bytes of a gzipped FileDescriptorProto 422 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x84, 0x93, 0x5f, 0x8b, 0xd3, 0x4c, 423 | 0x14, 0x87, 0x3b, 0x99, 0xb4, 0xdb, 0x9c, 0x96, 0x7d, 0xcb, 0xf0, 0x8a, 0x43, 0x10, 0x0c, 0x05, 424 | 0x65, 0x58, 0x97, 0x54, 0xe3, 0x1f, 0xc4, 0x3b, 0x8b, 0x42, 0x2f, 0x64, 0x59, 0xe2, 0xe2, 0xed, 425 | 0x92, 0xd6, 0x89, 0x5b, 0x36, 0x6d, 0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20, 0x0f, 0x83, 0x64, 0x7c, 0x48, 0x33, 0x6d, 0xd5, 0xc7, 0xb5, 0x35, 0x9b, 448 | 0x94, 0xf8, 0xf0, 0xcc, 0x9d, 0x5b, 0x6a, 0x89, 0x11, 0xf0, 0x6b, 0xbd, 0xd9, 0xbe, 0x17, 0x97, 449 | 0xe2, 0xd9, 0x76, 0x08, 0x3a, 0xcd, 0x83, 0xe4, 0xc1, 0x3f, 0x77, 0x3d, 0x75, 0xcc, 0x3b, 0xef, 450 | 0x2d, 0x9b, 0x3e, 0x07, 0x59, 0x9a, 0x6f, 0x6d, 0xac, 0xb9, 0x30, 0xd3, 0xff, 0x9a, 0x04, 0xfd, 451 | 0x69, 0x7d, 0xce, 0x7e, 0x33, 0x36, 0xef, 0xd1, 0x0d, 0x7a, 0xf9, 0x27, 0x00, 0x00, 0xff, 0xff, 452 | 0xa3, 0xf5, 0xa3, 0x55, 0xf8, 0x03, 0x00, 0x00, 453 | } 454 | -------------------------------------------------------------------------------- /config/config.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | //go:generate protoc --go_out=. config.proto 4 | -------------------------------------------------------------------------------- /config/config.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. 2 | // source: tensorflow/core/protobuf/config.proto 3 | // DO NOT EDIT! 4 | 5 | /* 6 | Package config is a generated protocol buffer package. 7 | 8 | It is generated from these files: 9 | tensorflow/core/protobuf/config.proto 10 | tensorflow/core/framework/allocation_description.proto 11 | tensorflow/core/framework/attr_value.proto 12 | tensorflow/core/framework/cost_graph.proto 13 | tensorflow/core/framework/device_attributes.proto 14 | tensorflow/core/framework/function.proto 15 | tensorflow/core/framework/graph.proto 16 | tensorflow/core/framework/kernel_def.proto 17 | tensorflow/core/framework/log_memory.proto 18 | tensorflow/core/framework/op_def.proto 19 | tensorflow/core/framework/step_stats.proto 20 | tensorflow/core/framework/summary.proto 21 | tensorflow/core/framework/tensor.proto 22 | tensorflow/core/framework/tensor_description.proto 23 | tensorflow/core/framework/tensor_shape.proto 24 | tensorflow/core/framework/tensor_slice.proto 25 | tensorflow/core/framework/types.proto 26 | tensorflow/core/framework/variable.proto 27 | tensorflow/core/framework/versions.proto 28 | 29 | It has these top-level messages: 30 | GPUOptions 31 | OptimizerOptions 32 | GraphOptions 33 | ThreadPoolOptionProto 34 | ConfigProto 35 | DebugTensorWatch 36 | RunOptions 37 | RunMetadata 38 | AllocationDescription 39 | AttrValue 40 | NameAttrList 41 | CostGraphDef 42 | DeviceAttributes 43 | FunctionDefLibrary 44 | FunctionDef 45 | GradientDef 46 | GraphDef 47 | NodeDef 48 | KernelDef 49 | MemoryLogStep 50 | MemoryLogTensorAllocation 51 | MemoryLogTensorDeallocation 52 | MemoryLogTensorOutput 53 | MemoryLogRawAllocation 54 | MemoryLogRawDeallocation 55 | OpDef 56 | OpDeprecation 57 | OpList 58 | AllocatorMemoryUsed 59 | NodeOutput 60 | NodeExecStats 61 | DeviceStepStats 62 | StepStats 63 | HistogramProto 64 | Summary 65 | TensorProto 66 | TensorDescription 67 | TensorShapeProto 68 | TensorSliceProto 69 | VariableDef 70 | SaveSliceInfoDef 71 | VersionDef 72 | */ 73 | package config 74 | 75 | import proto "github.com/golang/protobuf/proto" 76 | import fmt "fmt" 77 | import math "math" 78 | 79 | // Reference imports to suppress errors if they are not otherwise used. 80 | var _ = proto.Marshal 81 | var _ = fmt.Errorf 82 | var _ = math.Inf 83 | 84 | // This is a compile-time assertion to ensure that this generated file 85 | // is compatible with the proto package it is being compiled against. 86 | // A compilation error at this line likely means your copy of the 87 | // proto package needs to be updated. 88 | const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package 89 | 90 | // Optimization level 91 | type OptimizerOptions_Level int32 92 | 93 | const ( 94 | // L1 is the default level. 95 | // Optimization performed at L1 : 96 | // 1. Common subexpression elimination 97 | // 2. Constant folding 98 | OptimizerOptions_L1 OptimizerOptions_Level = 0 99 | // No optimizations 100 | OptimizerOptions_L0 OptimizerOptions_Level = -1 101 | ) 102 | 103 | var OptimizerOptions_Level_name = map[int32]string{ 104 | 0: "L1", 105 | -1: "L0", 106 | } 107 | var OptimizerOptions_Level_value = map[string]int32{ 108 | "L1": 0, 109 | "L0": -1, 110 | } 111 | 112 | func (x OptimizerOptions_Level) String() string { 113 | return proto.EnumName(OptimizerOptions_Level_name, int32(x)) 114 | } 115 | func (OptimizerOptions_Level) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 0} } 116 | 117 | // TODO(pbar) Turn this into a TraceOptions proto which allows 118 | // tracing to be controlled in a more orthogonal manner? 119 | type RunOptions_TraceLevel int32 120 | 121 | const ( 122 | RunOptions_NO_TRACE RunOptions_TraceLevel = 0 123 | RunOptions_SOFTWARE_TRACE RunOptions_TraceLevel = 1 124 | RunOptions_HARDWARE_TRACE RunOptions_TraceLevel = 2 125 | RunOptions_FULL_TRACE RunOptions_TraceLevel = 3 126 | ) 127 | 128 | var RunOptions_TraceLevel_name = map[int32]string{ 129 | 0: "NO_TRACE", 130 | 1: "SOFTWARE_TRACE", 131 | 2: "HARDWARE_TRACE", 132 | 3: "FULL_TRACE", 133 | } 134 | var RunOptions_TraceLevel_value = map[string]int32{ 135 | "NO_TRACE": 0, 136 | "SOFTWARE_TRACE": 1, 137 | "HARDWARE_TRACE": 2, 138 | "FULL_TRACE": 3, 139 | } 140 | 141 | func (x RunOptions_TraceLevel) String() string { 142 | return proto.EnumName(RunOptions_TraceLevel_name, int32(x)) 143 | } 144 | func (RunOptions_TraceLevel) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{6, 0} } 145 | 146 | type GPUOptions struct { 147 | // A value between 0 and 1 that indicates what fraction of the 148 | // available GPU memory to pre-allocate for each process. 1 means 149 | // to pre-allocate all of the GPU memory, 0.5 means the process 150 | // allocates ~50% of the available GPU memory. 151 | PerProcessGpuMemoryFraction float64 `protobuf:"fixed64,1,opt,name=per_process_gpu_memory_fraction,json=perProcessGpuMemoryFraction" json:"per_process_gpu_memory_fraction,omitempty"` 152 | // The type of GPU allocation strategy to use. 153 | // 154 | // Allowed values: 155 | // "": The empty string (default) uses a system-chosen default 156 | // which may change over time. 157 | // 158 | // "BFC": A "Best-fit with coalescing" algorithm, simplified from a 159 | // version of dlmalloc. 160 | AllocatorType string `protobuf:"bytes,2,opt,name=allocator_type,json=allocatorType" json:"allocator_type,omitempty"` 161 | // Delay deletion of up to this many bytes to reduce the number of 162 | // interactions with gpu driver code. If 0, the system chooses 163 | // a reasonable default (several MBs). 164 | DeferredDeletionBytes int64 `protobuf:"varint,3,opt,name=deferred_deletion_bytes,json=deferredDeletionBytes" json:"deferred_deletion_bytes,omitempty"` 165 | // If true, the allocator does not pre-allocate the entire specified 166 | // GPU memory region, instead starting small and growing as needed. 167 | AllowGrowth bool `protobuf:"varint,4,opt,name=allow_growth,json=allowGrowth" json:"allow_growth,omitempty"` 168 | } 169 | 170 | func (m *GPUOptions) Reset() { *m = GPUOptions{} } 171 | func (m *GPUOptions) String() string { return proto.CompactTextString(m) } 172 | func (*GPUOptions) ProtoMessage() {} 173 | func (*GPUOptions) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } 174 | 175 | // Options passed to the graph optimizer 176 | type OptimizerOptions struct { 177 | // If true, optimize the graph using common subexpression elimination. 178 | DoCommonSubexpressionElimination bool `protobuf:"varint,1,opt,name=do_common_subexpression_elimination,json=doCommonSubexpressionElimination" json:"do_common_subexpression_elimination,omitempty"` 179 | // If true, perform constant folding optimization on the graph. 180 | DoConstantFolding bool `protobuf:"varint,2,opt,name=do_constant_folding,json=doConstantFolding" json:"do_constant_folding,omitempty"` 181 | // If true, perform function inlining on the graph. 182 | DoFunctionInlining bool `protobuf:"varint,4,opt,name=do_function_inlining,json=doFunctionInlining" json:"do_function_inlining,omitempty"` 183 | OptLevel OptimizerOptions_Level `protobuf:"varint,3,opt,name=opt_level,json=optLevel,enum=tensorflow.OptimizerOptions_Level" json:"opt_level,omitempty"` 184 | } 185 | 186 | func (m *OptimizerOptions) Reset() { *m = OptimizerOptions{} } 187 | func (m *OptimizerOptions) String() string { return proto.CompactTextString(m) } 188 | func (*OptimizerOptions) ProtoMessage() {} 189 | func (*OptimizerOptions) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } 190 | 191 | type GraphOptions struct { 192 | // If true, use control flow to schedule the activation of Recv nodes. 193 | // (Currently ignored.) 194 | EnableRecvScheduling bool `protobuf:"varint,2,opt,name=enable_recv_scheduling,json=enableRecvScheduling" json:"enable_recv_scheduling,omitempty"` 195 | // Options controlling how graph is optimized. 196 | OptimizerOptions *OptimizerOptions `protobuf:"bytes,3,opt,name=optimizer_options,json=optimizerOptions" json:"optimizer_options,omitempty"` 197 | // The number of steps to run before returning a cost model detailing 198 | // the memory usage and performance of each node of the graph. 0 means 199 | // no cost model. 200 | BuildCostModel int64 `protobuf:"varint,4,opt,name=build_cost_model,json=buildCostModel" json:"build_cost_model,omitempty"` 201 | // Annotate each Node with Op output shape data, to the extent it can 202 | // be statically inferred. 203 | InferShapes bool `protobuf:"varint,5,opt,name=infer_shapes,json=inferShapes" json:"infer_shapes,omitempty"` 204 | // Only place the subgraphs that are run, rather than the entire graph. 205 | // 206 | // This is useful for interactive graph building, where one might 207 | // produce graphs that cannot be placed during the debugging 208 | // process. In particular, it allows the client to continue work in 209 | // a session after adding a node to a graph whose placement 210 | // constraints are unsatisfiable. 211 | PlacePrunedGraph bool `protobuf:"varint,6,opt,name=place_pruned_graph,json=placePrunedGraph" json:"place_pruned_graph,omitempty"` 212 | } 213 | 214 | func (m *GraphOptions) Reset() { *m = GraphOptions{} } 215 | func (m *GraphOptions) String() string { return proto.CompactTextString(m) } 216 | func (*GraphOptions) ProtoMessage() {} 217 | func (*GraphOptions) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } 218 | 219 | func (m *GraphOptions) GetOptimizerOptions() *OptimizerOptions { 220 | if m != nil { 221 | return m.OptimizerOptions 222 | } 223 | return nil 224 | } 225 | 226 | type ThreadPoolOptionProto struct { 227 | // The number of threads in the pool. 228 | // 229 | // 0 means the system picks a value based on where this option proto is used 230 | // (see the declaration of the specific field for more info). 231 | NumThreads int32 `protobuf:"varint,1,opt,name=num_threads,json=numThreads" json:"num_threads,omitempty"` 232 | } 233 | 234 | func (m *ThreadPoolOptionProto) Reset() { *m = ThreadPoolOptionProto{} } 235 | func (m *ThreadPoolOptionProto) String() string { return proto.CompactTextString(m) } 236 | func (*ThreadPoolOptionProto) ProtoMessage() {} 237 | func (*ThreadPoolOptionProto) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } 238 | 239 | // Session configuration parameters. 240 | // The system picks an appropriate values for fields that are not set. 241 | type ConfigProto struct { 242 | // Map from device type name (e.g., "CPU" or "GPU" ) to maximum 243 | // number of devices of that type to use. If a particular device 244 | // type is not found in the map, the system picks an appropriate 245 | // number. 246 | DeviceCount map[string]int32 `protobuf:"bytes,1,rep,name=device_count,json=deviceCount" json:"device_count,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` 247 | // The execution of an individual op (for some op types) can be 248 | // parallelized on a pool of intra_op_parallelism_threads. 249 | // 0 means the system picks an appropriate number. 250 | IntraOpParallelismThreads int32 `protobuf:"varint,2,opt,name=intra_op_parallelism_threads,json=intraOpParallelismThreads" json:"intra_op_parallelism_threads,omitempty"` 251 | // Nodes that perform blocking operations are enqueued on a pool of 252 | // inter_op_parallelism_threads available in each process. 253 | // 254 | // 0 means the system picks an appropriate number. 255 | // 256 | // Note that the first Session created in the process sets the 257 | // number of threads for all future sessions unless use_per_session_threads is 258 | // true or session_inter_op_thread_pool is configured. 259 | InterOpParallelismThreads int32 `protobuf:"varint,5,opt,name=inter_op_parallelism_threads,json=interOpParallelismThreads" json:"inter_op_parallelism_threads,omitempty"` 260 | // If true, use a new set of threads for this session rather than the global 261 | // pool of threads. Only supported by direct sessions. 262 | // 263 | // If false, use the global threads created by the first session, or the 264 | // per-session thread pools configured by session_inter_op_thread_pool. 265 | // 266 | // This option is deprecated. The same effect can be achieved by setting 267 | // session_inter_op_thread_pool to have one element, whose num_threads equals 268 | // inter_op_parallelism_threads. 269 | UsePerSessionThreads bool `protobuf:"varint,9,opt,name=use_per_session_threads,json=usePerSessionThreads" json:"use_per_session_threads,omitempty"` 270 | // This option is experimental - it may be replaced with a different mechanism 271 | // in the future. The intended use is for when some session invocations need 272 | // to run in a background pool limited to a small number of threads. 273 | // 274 | // Configures session thread pools. If this is configured, then RunOptions for 275 | // a Run call can select the thread pool to use. 276 | // 277 | // If a pool's num_threads is 0, then inter_op_parallelism_threads is used. 278 | SessionInterOpThreadPool []*ThreadPoolOptionProto `protobuf:"bytes,12,rep,name=session_inter_op_thread_pool,json=sessionInterOpThreadPool" json:"session_inter_op_thread_pool,omitempty"` 279 | // Assignment of Nodes to Devices is recomputed every placement_period 280 | // steps until the system warms up (at which point the recomputation 281 | // typically slows down automatically). 282 | PlacementPeriod int32 `protobuf:"varint,3,opt,name=placement_period,json=placementPeriod" json:"placement_period,omitempty"` 283 | // When any filters are present sessions will ignore all devices which do not 284 | // match the filters. Each filter can be partially specified, e.g. "/job:ps" 285 | // "/job:worker/replica:3", etc. 286 | DeviceFilters []string `protobuf:"bytes,4,rep,name=device_filters,json=deviceFilters" json:"device_filters,omitempty"` 287 | // Options that apply to all GPUs. 288 | GpuOptions *GPUOptions `protobuf:"bytes,6,opt,name=gpu_options,json=gpuOptions" json:"gpu_options,omitempty"` 289 | // Whether soft placement is allowed. If allow_soft_placement is true, 290 | // an op will be placed on CPU if 291 | // 1. there's no GPU implementation for the OP 292 | // or 293 | // 2. no GPU devices are known or registered 294 | // or 295 | // 3. need to co-locate with reftype input(s) which are from CPU. 296 | AllowSoftPlacement bool `protobuf:"varint,7,opt,name=allow_soft_placement,json=allowSoftPlacement" json:"allow_soft_placement,omitempty"` 297 | // Whether device placements should be logged. 298 | LogDevicePlacement bool `protobuf:"varint,8,opt,name=log_device_placement,json=logDevicePlacement" json:"log_device_placement,omitempty"` 299 | // Options that apply to all graphs. 300 | GraphOptions *GraphOptions `protobuf:"bytes,10,opt,name=graph_options,json=graphOptions" json:"graph_options,omitempty"` 301 | // Global timeout for all blocking operations in this session. If non-zero, 302 | // and not overridden on a per-operation basis, this value will be used as the 303 | // deadline for all blocking operations. 304 | OperationTimeoutInMs int64 `protobuf:"varint,11,opt,name=operation_timeout_in_ms,json=operationTimeoutInMs" json:"operation_timeout_in_ms,omitempty"` 305 | } 306 | 307 | func (m *ConfigProto) Reset() { *m = ConfigProto{} } 308 | func (m *ConfigProto) String() string { return proto.CompactTextString(m) } 309 | func (*ConfigProto) ProtoMessage() {} 310 | func (*ConfigProto) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } 311 | 312 | func (m *ConfigProto) GetDeviceCount() map[string]int32 { 313 | if m != nil { 314 | return m.DeviceCount 315 | } 316 | return nil 317 | } 318 | 319 | func (m *ConfigProto) GetSessionInterOpThreadPool() []*ThreadPoolOptionProto { 320 | if m != nil { 321 | return m.SessionInterOpThreadPool 322 | } 323 | return nil 324 | } 325 | 326 | func (m *ConfigProto) GetGpuOptions() *GPUOptions { 327 | if m != nil { 328 | return m.GpuOptions 329 | } 330 | return nil 331 | } 332 | 333 | func (m *ConfigProto) GetGraphOptions() *GraphOptions { 334 | if m != nil { 335 | return m.GraphOptions 336 | } 337 | return nil 338 | } 339 | 340 | // EXPERIMENTAL. Option for watching a node. 341 | type DebugTensorWatch struct { 342 | // Name of the node to watch. 343 | NodeName string `protobuf:"bytes,1,opt,name=node_name,json=nodeName" json:"node_name,omitempty"` 344 | // Output slot to watch. 345 | // The semantics of output_slot == -1 is that the node is only watched for 346 | // completion, but not for any output tensors. See NodeCompletionCallback 347 | // in debug_gateway.h. 348 | // TODO(cais): Implement this semantics. 349 | OutputSlot int32 `protobuf:"varint,2,opt,name=output_slot,json=outputSlot" json:"output_slot,omitempty"` 350 | // Name(s) of the debugging op(s). 351 | // One or more than one probes on a tensor. 352 | // e.g., {"DebugIdentity", "DebugNanCount"} 353 | DebugOps []string `protobuf:"bytes,3,rep,name=debug_ops,json=debugOps" json:"debug_ops,omitempty"` 354 | // URL(s) for debug targets(s). 355 | // E.g., "file:///foo/tfdbg_dump", "grpc://localhost:11011" 356 | // Each debug op listed in debug_ops will publish its output tensor (debug 357 | // signal) to all URLs in debug_urls. 358 | DebugUrls []string `protobuf:"bytes,4,rep,name=debug_urls,json=debugUrls" json:"debug_urls,omitempty"` 359 | } 360 | 361 | func (m *DebugTensorWatch) Reset() { *m = DebugTensorWatch{} } 362 | func (m *DebugTensorWatch) String() string { return proto.CompactTextString(m) } 363 | func (*DebugTensorWatch) ProtoMessage() {} 364 | func (*DebugTensorWatch) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } 365 | 366 | // EXPERIMENTAL. Options for a single Run() call. 367 | type RunOptions struct { 368 | TraceLevel RunOptions_TraceLevel `protobuf:"varint,1,opt,name=trace_level,json=traceLevel,enum=tensorflow.RunOptions_TraceLevel" json:"trace_level,omitempty"` 369 | // Time to wait for operation to complete in milliseconds. 370 | TimeoutInMs int64 `protobuf:"varint,2,opt,name=timeout_in_ms,json=timeoutInMs" json:"timeout_in_ms,omitempty"` 371 | // The thread pool to use, if session_inter_op_thread_pool is configured. 372 | InterOpThreadPool int32 `protobuf:"varint,3,opt,name=inter_op_thread_pool,json=interOpThreadPool" json:"inter_op_thread_pool,omitempty"` 373 | // Debugging options 374 | DebugTensorWatchOpts []*DebugTensorWatch `protobuf:"bytes,4,rep,name=debug_tensor_watch_opts,json=debugTensorWatchOpts" json:"debug_tensor_watch_opts,omitempty"` 375 | } 376 | 377 | func (m *RunOptions) Reset() { *m = RunOptions{} } 378 | func (m *RunOptions) String() string { return proto.CompactTextString(m) } 379 | func (*RunOptions) ProtoMessage() {} 380 | func (*RunOptions) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } 381 | 382 | func (m *RunOptions) GetDebugTensorWatchOpts() []*DebugTensorWatch { 383 | if m != nil { 384 | return m.DebugTensorWatchOpts 385 | } 386 | return nil 387 | } 388 | 389 | // EXPERIMENTAL. Metadata output (i.e., non-Tensor) for a single Run() call. 390 | type RunMetadata struct { 391 | // Statistics traced for this step. Populated if tracing is turned on via the 392 | // "RunOptions" proto. 393 | // EXPERIMENTAL: The format and set of events may change in future versions. 394 | StepStats *StepStats `protobuf:"bytes,1,opt,name=step_stats,json=stepStats" json:"step_stats,omitempty"` 395 | // The cost graph for the computation defined by the run call. 396 | CostGraph *CostGraphDef `protobuf:"bytes,2,opt,name=cost_graph,json=costGraph" json:"cost_graph,omitempty"` 397 | } 398 | 399 | func (m *RunMetadata) Reset() { *m = RunMetadata{} } 400 | func (m *RunMetadata) String() string { return proto.CompactTextString(m) } 401 | func (*RunMetadata) ProtoMessage() {} 402 | func (*RunMetadata) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } 403 | 404 | func (m *RunMetadata) GetStepStats() *StepStats { 405 | if m != nil { 406 | return m.StepStats 407 | } 408 | return nil 409 | } 410 | 411 | func (m *RunMetadata) GetCostGraph() *CostGraphDef { 412 | if m != nil { 413 | return m.CostGraph 414 | } 415 | return nil 416 | } 417 | 418 | func init() { 419 | proto.RegisterType((*GPUOptions)(nil), "tensorflow.GPUOptions") 420 | proto.RegisterType((*OptimizerOptions)(nil), "tensorflow.OptimizerOptions") 421 | proto.RegisterType((*GraphOptions)(nil), "tensorflow.GraphOptions") 422 | proto.RegisterType((*ThreadPoolOptionProto)(nil), "tensorflow.ThreadPoolOptionProto") 423 | proto.RegisterType((*ConfigProto)(nil), "tensorflow.ConfigProto") 424 | proto.RegisterType((*DebugTensorWatch)(nil), "tensorflow.DebugTensorWatch") 425 | proto.RegisterType((*RunOptions)(nil), "tensorflow.RunOptions") 426 | proto.RegisterType((*RunMetadata)(nil), "tensorflow.RunMetadata") 427 | proto.RegisterEnum("tensorflow.OptimizerOptions_Level", OptimizerOptions_Level_name, OptimizerOptions_Level_value) 428 | proto.RegisterEnum("tensorflow.RunOptions_TraceLevel", RunOptions_TraceLevel_name, RunOptions_TraceLevel_value) 429 | } 430 | 431 | func init() { proto.RegisterFile("tensorflow/core/protobuf/config.proto", fileDescriptor0) } 432 | 433 | var fileDescriptor0 = []byte{ 434 | // 1215 bytes of a gzipped FileDescriptorProto 435 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x84, 0x56, 0xdd, 0x8e, 0x1b, 0x35, 436 | 0x14, 0xee, 0x24, 0xdd, 0x25, 0x39, 0x49, 0xb7, 0xa9, 0x49, 0xdb, 0xa1, 0x2d, 0x6a, 0x1a, 0x54, 437 | 0x29, 0x20, 0xc8, 0x96, 0xa5, 0xa5, 0x15, 0x12, 0x54, 0xdd, 0x5f, 0x16, 0x76, 0xbb, 0x91, 0x93, 438 | 0xaa, 0x97, 0xd6, 0x64, 0xc6, 0xc9, 0x8e, 0xea, 0xb1, 0x2d, 0xdb, 0xb3, 0xcb, 0x22, 0x1e, 0x81, 439 | 0x37, 0xe0, 0x9e, 0x57, 0xe0, 0x2d, 0xb8, 0xe2, 0x61, 0xb8, 0x03, 0xd9, 0x9e, 0xc9, 0x64, 0xc3, 440 | 0xaa, 0xe4, 0xca, 0xf3, 0x7d, 0xdf, 0x39, 0x73, 0x7c, 0xfc, 0xf9, 0x64, 0xe0, 0xb1, 0xa1, 0x5c, 441 | 0x0b, 0x35, 0x63, 0xe2, 0x7c, 0x33, 0x16, 0x8a, 0x6e, 0x4a, 0x25, 0x8c, 0x98, 0xe6, 0xb3, 0xcd, 442 | 0x58, 0xf0, 0x59, 0x3a, 0x1f, 0xba, 0x67, 0x04, 0x95, 0xec, 0xde, 0x67, 0xab, 0x21, 0x33, 0x15, 443 | 0x65, 0xf4, 0x5c, 0xa8, 0x77, 0x9b, 0xb1, 0xd0, 0x86, 0xcc, 0x55, 0x24, 0x4f, 0x7d, 0xdc, 0xfb, 444 | 0xb4, 0xda, 0x50, 0x49, 0xb4, 0x89, 0x8c, 0xf6, 0xda, 0xfe, 0x5f, 0x01, 0xc0, 0xc1, 0xe8, 0xcd, 445 | 0x89, 0x34, 0xa9, 0xe0, 0x1a, 0xed, 0xc2, 0x43, 0x49, 0x15, 0x91, 0x4a, 0xc4, 0x54, 0x6b, 0x32, 446 | 0x97, 0x39, 0xc9, 0x68, 0x26, 0xd4, 0x05, 0x99, 0xa9, 0x28, 0xb6, 0x9a, 0x30, 0xe8, 0x05, 0x83, 447 | 0x00, 0xdf, 0x97, 0x54, 0x8d, 0xbc, 0xea, 0x40, 0xe6, 0xc7, 0x4e, 0xb3, 0x5f, 0x48, 0xd0, 0x63, 448 | 0xd8, 0x88, 0x18, 0x13, 0x71, 0x64, 0x84, 0x22, 0xe6, 0x42, 0xd2, 0xb0, 0xd6, 0x0b, 0x06, 0x4d, 449 | 0x7c, 0x63, 0x81, 0x4e, 0x2e, 0x24, 0x45, 0x5f, 0xc3, 0xdd, 0x84, 0xce, 0xa8, 0x52, 0x34, 0x21, 450 | 0x09, 0x65, 0xd4, 0xc6, 0x92, 0xe9, 0x85, 0xa1, 0x3a, 0xac, 0xf7, 0x82, 0x41, 0x1d, 0xdf, 0x2e, 451 | 0xe9, 0xdd, 0x82, 0xdd, 0xb6, 0x24, 0x7a, 0x04, 0x6d, 0x9b, 0xe8, 0x9c, 0xcc, 0x95, 0x38, 0x37, 452 | 0xa7, 0xe1, 0xf5, 0x5e, 0x30, 0x68, 0xe0, 0x96, 0xc3, 0x0e, 0x1c, 0xd4, 0xff, 0xbd, 0x06, 0x1d, 453 | 0xbb, 0xa7, 0x2c, 0xfd, 0x99, 0xaa, 0x72, 0x73, 0xc7, 0xf0, 0x49, 0x22, 0x48, 0x2c, 0xb2, 0x4c, 454 | 0x70, 0xa2, 0xf3, 0x29, 0xfd, 0x49, 0x2a, 0xaa, 0xb5, 0x7d, 0x2b, 0x65, 0x69, 0x96, 0xf2, 0x68, 455 | 0xb1, 0xc1, 0x06, 0xee, 0x25, 0x62, 0xc7, 0x29, 0xc7, 0xcb, 0xc2, 0xbd, 0x4a, 0x87, 0x86, 0xf0, 456 | 0xa1, 0x4b, 0xc7, 0xb5, 0x89, 0xb8, 0x21, 0x33, 0xc1, 0x92, 0x94, 0xcf, 0xdd, 0x56, 0x1b, 0xf8, 457 | 0x96, 0x0d, 0xf7, 0xcc, 0xbe, 0x27, 0xd0, 0x13, 0xe8, 0x26, 0x82, 0xcc, 0x72, 0xee, 0x9a, 0x44, 458 | 0x52, 0xce, 0x52, 0x6e, 0x03, 0x7c, 0xf9, 0x28, 0x11, 0xfb, 0x05, 0x75, 0x58, 0x30, 0xe8, 0x25, 459 | 0x34, 0x85, 0x34, 0x84, 0xd1, 0x33, 0xca, 0x5c, 0x4b, 0x36, 0xb6, 0xfa, 0xc3, 0xea, 0x70, 0x87, 460 | 0xab, 0x3b, 0x1c, 0x1e, 0x59, 0x25, 0x6e, 0x08, 0x69, 0xdc, 0xaa, 0xdf, 0x83, 0x35, 0xb7, 0x40, 461 | 0xeb, 0x50, 0x3b, 0xfa, 0xb2, 0x73, 0x0d, 0xdd, 0x84, 0xda, 0xd1, 0x93, 0xce, 0x3f, 0xe5, 0x2f, 462 | 0xe8, 0xff, 0x51, 0x83, 0xf6, 0x81, 0xf5, 0x4e, 0xd9, 0xa4, 0xa7, 0x70, 0x87, 0xf2, 0x68, 0xca, 463 | 0x28, 0x51, 0x34, 0x3e, 0x23, 0x3a, 0x3e, 0xa5, 0x49, 0xce, 0xaa, 0x8d, 0x75, 0x3d, 0x8b, 0x69, 464 | 0x7c, 0x36, 0x5e, 0x70, 0xe8, 0x10, 0x6e, 0x89, 0xb2, 0x18, 0x22, 0x7c, 0x2a, 0x57, 0x71, 0x6b, 465 | 0xeb, 0xc1, 0xfb, 0x2a, 0xc6, 0x1d, 0xb1, 0x7a, 0x4a, 0x03, 0xe8, 0x4c, 0xf3, 0x94, 0x25, 0xc4, 466 | 0xf9, 0x3a, 0x13, 0x09, 0x65, 0xae, 0x45, 0x75, 0xbc, 0xe1, 0xf0, 0x1d, 0xa1, 0xcd, 0xb1, 0x45, 467 | 0xad, 0x0f, 0x52, 0x3e, 0xa3, 0x8a, 0xe8, 0xd3, 0x48, 0x52, 0x1d, 0xae, 0x79, 0x1f, 0x38, 0x6c, 468 | 0xec, 0x20, 0xf4, 0x39, 0x20, 0xc9, 0xa2, 0x98, 0x12, 0xa9, 0x72, 0x4e, 0x13, 0x7f, 0x4d, 0xc2, 469 | 0x75, 0x27, 0xec, 0x38, 0x66, 0xe4, 0x08, 0xd7, 0x82, 0x1f, 0xae, 0x37, 0x82, 0x4e, 0x0d, 0x3f, 470 | 0xd6, 0xef, 0x52, 0xf9, 0xbf, 0x36, 0xe9, 0xbf, 0x80, 0xdb, 0x93, 0x53, 0x45, 0xa3, 0x64, 0x24, 471 | 0x04, 0xf3, 0xc5, 0x8f, 0xdc, 0xb5, 0x7d, 0x08, 0x2d, 0x9e, 0x67, 0xc4, 0x38, 0x52, 0x3b, 0x3b, 472 | 0xad, 0x61, 0xe0, 0x79, 0xe6, 0xe5, 0xba, 0xff, 0xdb, 0x3a, 0xb4, 0x76, 0xdc, 0x45, 0xf7, 0x01, 473 | 0x3f, 0x42, 0x3b, 0xa1, 0x67, 0x69, 0x4c, 0x49, 0x2c, 0x72, 0x6e, 0xc2, 0xa0, 0x57, 0x1f, 0xb4, 474 | 0xb6, 0x06, 0xcb, 0x7d, 0x5b, 0x92, 0x0f, 0x77, 0x9d, 0x76, 0xc7, 0x4a, 0xf7, 0xb8, 0x51, 0x17, 475 | 0xb8, 0x95, 0x54, 0x08, 0x7a, 0x09, 0x0f, 0x52, 0x6e, 0x54, 0x44, 0x84, 0x24, 0x32, 0x52, 0x11, 476 | 0x63, 0x94, 0xa5, 0xba, 0x2a, 0xa7, 0xe6, 0xca, 0xf9, 0xc8, 0x69, 0x4e, 0xe4, 0xa8, 0x52, 0x14, 477 | 0xd5, 0x15, 0x09, 0xdc, 0x31, 0x5e, 0x99, 0x60, 0x6d, 0x91, 0xc0, 0x9e, 0xd9, 0x15, 0x09, 0x9e, 478 | 0xc1, 0xdd, 0x5c, 0x53, 0x62, 0xe7, 0x88, 0x2e, 0xfa, 0x56, 0xc6, 0x36, 0xbd, 0x85, 0x72, 0x4d, 479 | 0x47, 0x54, 0x8d, 0x3d, 0x59, 0x86, 0x45, 0xf0, 0xa0, 0x94, 0x2f, 0xde, 0xef, 0xe3, 0x88, 0x14, 480 | 0x82, 0x85, 0x6d, 0xd7, 0x95, 0x47, 0xcb, 0x5d, 0xb9, 0xb2, 0xff, 0x38, 0x2c, 0xd2, 0x1c, 0xfa, 481 | 0x0a, 0x2b, 0x11, 0xfa, 0x14, 0xfc, 0x99, 0x67, 0x94, 0x1b, 0x5b, 0x5f, 0x2a, 0x12, 0x67, 0xd2, 482 | 0x35, 0x7c, 0x73, 0x81, 0x8f, 0x1c, 0x6c, 0x47, 0x58, 0x71, 0x26, 0xb3, 0x94, 0x19, 0xaa, 0x74, 483 | 0x78, 0xbd, 0x57, 0xb7, 0x23, 0xcc, 0xa3, 0xfb, 0x1e, 0x44, 0xcf, 0xa1, 0x65, 0x67, 0x64, 0xe9, 484 | 0xf8, 0x75, 0xe7, 0xf8, 0x3b, 0xcb, 0x35, 0x56, 0xc3, 0x15, 0xc3, 0x5c, 0xe6, 0xa5, 0xcb, 0x9f, 485 | 0x40, 0xd7, 0xcf, 0x30, 0x2d, 0x66, 0x86, 0x2c, 0xde, 0x1e, 0x7e, 0xe0, 0x87, 0x81, 0xe3, 0xc6, 486 | 0x62, 0x66, 0x46, 0x25, 0x63, 0x23, 0x98, 0x98, 0x93, 0xa2, 0xaa, 0x2a, 0xa2, 0xe1, 0x23, 0x98, 487 | 0x98, 0x7b, 0x63, 0x54, 0x11, 0xdf, 0xc2, 0x0d, 0xe7, 0xf7, 0x45, 0x79, 0xe0, 0xca, 0x0b, 0x2f, 488 | 0x95, 0xb7, 0x74, 0xf7, 0x71, 0x7b, 0xbe, 0x3c, 0x09, 0x9e, 0xc1, 0x5d, 0x21, 0xa9, 0x72, 0x6e, 489 | 0x27, 0x26, 0xcd, 0xa8, 0xc8, 0x0d, 0x49, 0x39, 0xc9, 0x74, 0xd8, 0x72, 0xf7, 0xb1, 0xbb, 0xa0, 490 | 0x27, 0x9e, 0x3d, 0xe4, 0xc7, 0xfa, 0xde, 0x77, 0xd0, 0x59, 0x75, 0x28, 0xea, 0x40, 0xfd, 0x1d, 491 | 0xbd, 0x70, 0x57, 0xa1, 0x89, 0xed, 0x12, 0x75, 0x61, 0xed, 0x2c, 0x62, 0x39, 0x2d, 0xfc, 0xe8, 492 | 0x1f, 0xbe, 0xa9, 0xbd, 0x08, 0xfa, 0xbf, 0x06, 0x36, 0xc1, 0x34, 0x9f, 0x4f, 0x5c, 0x95, 0x6f, 493 | 0x23, 0x13, 0x9f, 0xa2, 0xfb, 0xd0, 0xe4, 0x22, 0xa1, 0x84, 0x47, 0x19, 0x2d, 0xd2, 0x34, 0x2c, 494 | 0xf0, 0x3a, 0xca, 0xa8, 0xbd, 0x70, 0x22, 0x37, 0x32, 0x37, 0x44, 0x33, 0x61, 0x8a, 0x8c, 0xe0, 495 | 0xa1, 0x31, 0x13, 0xc6, 0x46, 0x27, 0x36, 0x23, 0x11, 0xd2, 0x4e, 0x25, 0x7b, 0x8e, 0x0d, 0x07, 496 | 0x9c, 0x48, 0x8d, 0x3e, 0x06, 0xf0, 0x64, 0xae, 0x58, 0x79, 0xca, 0x5e, 0xfe, 0x46, 0x31, 0xdd, 497 | 0xff, 0xb3, 0x06, 0x80, 0x73, 0x5e, 0x36, 0x65, 0x1b, 0x5a, 0x46, 0xd9, 0x81, 0xe2, 0x87, 0x72, 498 | 0xe0, 0x86, 0xf2, 0x25, 0x53, 0x56, 0xe2, 0xe1, 0xc4, 0x2a, 0xfd, 0x4c, 0x06, 0xb3, 0x58, 0xa3, 499 | 0x3e, 0xdc, 0xb8, 0xdc, 0xce, 0x9a, 0x6b, 0x67, 0xcb, 0x54, 0x5d, 0x44, 0x9b, 0xd0, 0xbd, 0xf2, 500 | 0x16, 0x78, 0xbb, 0xde, 0x4a, 0xff, 0xe3, 0xed, 0xb1, 0xfd, 0x33, 0xb5, 0xdb, 0xf0, 0xa5, 0x90, 501 | 0x73, 0xdb, 0x37, 0x7b, 0xf2, 0x7e, 0x4f, 0x2b, 0x73, 0x78, 0xb5, 0xc1, 0xb8, 0x9b, 0xac, 0x20, 502 | 0x27, 0xd2, 0xe8, 0x3e, 0x06, 0xa8, 0xf6, 0x80, 0xda, 0xd0, 0x78, 0x7d, 0x42, 0x26, 0xf8, 0xd5, 503 | 0xce, 0x5e, 0xe7, 0x1a, 0x42, 0xb0, 0x31, 0x3e, 0xd9, 0x9f, 0xbc, 0x7d, 0x85, 0xf7, 0x0a, 0x2c, 504 | 0xb0, 0xd8, 0xf7, 0xaf, 0xf0, 0xee, 0x12, 0x56, 0x43, 0x1b, 0x00, 0xfb, 0x6f, 0x8e, 0x8e, 0x8a, 505 | 0xe7, 0x7a, 0xff, 0x17, 0x68, 0xe1, 0x9c, 0x1f, 0x53, 0x13, 0x25, 0x91, 0x89, 0xd0, 0x53, 0x80, 506 | 0xea, 0xa3, 0xc4, 0xf5, 0xb3, 0xb5, 0x75, 0x7b, 0xb9, 0xd4, 0xb1, 0xa1, 0x72, 0x6c, 0x49, 0xdc, 507 | 0xd4, 0xe5, 0x12, 0x3d, 0x07, 0xa8, 0x3e, 0x7b, 0x5c, 0xff, 0x56, 0x7c, 0x6d, 0xff, 0x25, 0x9c, 508 | 0xb7, 0x77, 0xe9, 0x0c, 0x37, 0xe3, 0xf2, 0x69, 0xfb, 0x0b, 0x08, 0x85, 0x9a, 0x2f, 0x2b, 0x17, 509 | 0x1f, 0x47, 0xdb, 0xed, 0xa5, 0x29, 0xab, 0x47, 0xc1, 0xdf, 0x41, 0x30, 0x5d, 0x77, 0x5f, 0x49, 510 | 0x5f, 0xfd, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x0d, 0x17, 0x62, 0xb0, 0xb2, 0x09, 0x00, 0x00, 511 | } 512 | -------------------------------------------------------------------------------- /config/cost_graph.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. 2 | // source: tensorflow/core/framework/cost_graph.proto 3 | // DO NOT EDIT! 4 | 5 | package config 6 | 7 | import proto "github.com/golang/protobuf/proto" 8 | import fmt "fmt" 9 | import math "math" 10 | 11 | // Reference imports to suppress errors if they are not otherwise used. 12 | var _ = proto.Marshal 13 | var _ = fmt.Errorf 14 | var _ = math.Inf 15 | 16 | type CostGraphDef struct { 17 | Node []*CostGraphDef_Node `protobuf:"bytes,1,rep,name=node" json:"node,omitempty"` 18 | } 19 | 20 | func (m *CostGraphDef) Reset() { *m = CostGraphDef{} } 21 | func (m *CostGraphDef) String() string { return proto.CompactTextString(m) } 22 | func (*CostGraphDef) ProtoMessage() {} 23 | func (*CostGraphDef) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } 24 | 25 | func (m *CostGraphDef) GetNode() []*CostGraphDef_Node { 26 | if m != nil { 27 | return m.Node 28 | } 29 | return nil 30 | } 31 | 32 | type CostGraphDef_Node struct { 33 | // The name of the node. 34 | Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` 35 | // The device of the node. 36 | Device string `protobuf:"bytes,2,opt,name=device" json:"device,omitempty"` 37 | // The id of the node. 38 | Id int32 `protobuf:"varint,3,opt,name=id" json:"id,omitempty"` 39 | InputInfo []*CostGraphDef_Node_InputInfo `protobuf:"bytes,4,rep,name=input_info,json=inputInfo" json:"input_info,omitempty"` 40 | OutputInfo []*CostGraphDef_Node_OutputInfo `protobuf:"bytes,5,rep,name=output_info,json=outputInfo" json:"output_info,omitempty"` 41 | // Temporary memory used by this node. 42 | TemporaryMemorySize int64 `protobuf:"varint,6,opt,name=temporary_memory_size,json=temporaryMemorySize" json:"temporary_memory_size,omitempty"` 43 | // If true, the output is permanent: it can't be discarded, because this 44 | // node is part of the "final output". Nodes may depend on final nodes. 45 | IsFinal bool `protobuf:"varint,7,opt,name=is_final,json=isFinal" json:"is_final,omitempty"` 46 | // Ids of the control inputs for this node. 47 | ControlInput []int32 `protobuf:"varint,8,rep,packed,name=control_input,json=controlInput" json:"control_input,omitempty"` 48 | } 49 | 50 | func (m *CostGraphDef_Node) Reset() { *m = CostGraphDef_Node{} } 51 | func (m *CostGraphDef_Node) String() string { return proto.CompactTextString(m) } 52 | func (*CostGraphDef_Node) ProtoMessage() {} 53 | func (*CostGraphDef_Node) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0, 0} } 54 | 55 | func (m *CostGraphDef_Node) GetInputInfo() []*CostGraphDef_Node_InputInfo { 56 | if m != nil { 57 | return m.InputInfo 58 | } 59 | return nil 60 | } 61 | 62 | func (m *CostGraphDef_Node) GetOutputInfo() []*CostGraphDef_Node_OutputInfo { 63 | if m != nil { 64 | return m.OutputInfo 65 | } 66 | return nil 67 | } 68 | 69 | // Inputs of this node. They must be executed before this node can be 70 | // executed. An input is a particular output of another node, specified 71 | // by the node id and the output index. 72 | type CostGraphDef_Node_InputInfo struct { 73 | PrecedingNode int32 `protobuf:"varint,1,opt,name=preceding_node,json=precedingNode" json:"preceding_node,omitempty"` 74 | PrecedingPort int32 `protobuf:"varint,2,opt,name=preceding_port,json=precedingPort" json:"preceding_port,omitempty"` 75 | } 76 | 77 | func (m *CostGraphDef_Node_InputInfo) Reset() { *m = CostGraphDef_Node_InputInfo{} } 78 | func (m *CostGraphDef_Node_InputInfo) String() string { return proto.CompactTextString(m) } 79 | func (*CostGraphDef_Node_InputInfo) ProtoMessage() {} 80 | func (*CostGraphDef_Node_InputInfo) Descriptor() ([]byte, []int) { 81 | return fileDescriptor3, []int{0, 0, 0} 82 | } 83 | 84 | // Outputs of this node. 85 | type CostGraphDef_Node_OutputInfo struct { 86 | Size int64 `protobuf:"varint,1,opt,name=size" json:"size,omitempty"` 87 | // If >= 0, the output is an alias of an input. Note that an alias input 88 | // may itself be an alias. The algorithm will therefore need to follow 89 | // those pointers. 90 | AliasInputPort int64 `protobuf:"varint,2,opt,name=alias_input_port,json=aliasInputPort" json:"alias_input_port,omitempty"` 91 | } 92 | 93 | func (m *CostGraphDef_Node_OutputInfo) Reset() { *m = CostGraphDef_Node_OutputInfo{} } 94 | func (m *CostGraphDef_Node_OutputInfo) String() string { return proto.CompactTextString(m) } 95 | func (*CostGraphDef_Node_OutputInfo) ProtoMessage() {} 96 | func (*CostGraphDef_Node_OutputInfo) Descriptor() ([]byte, []int) { 97 | return fileDescriptor3, []int{0, 0, 1} 98 | } 99 | 100 | func init() { 101 | proto.RegisterType((*CostGraphDef)(nil), "tensorflow.CostGraphDef") 102 | proto.RegisterType((*CostGraphDef_Node)(nil), "tensorflow.CostGraphDef.Node") 103 | proto.RegisterType((*CostGraphDef_Node_InputInfo)(nil), "tensorflow.CostGraphDef.Node.InputInfo") 104 | proto.RegisterType((*CostGraphDef_Node_OutputInfo)(nil), "tensorflow.CostGraphDef.Node.OutputInfo") 105 | } 106 | 107 | func init() { proto.RegisterFile("tensorflow/core/framework/cost_graph.proto", fileDescriptor3) } 108 | 109 | var fileDescriptor3 = []byte{ 110 | // 402 bytes of a gzipped FileDescriptorProto 111 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x7c, 0x52, 0x4d, 0x6f, 0xd4, 0x30, 112 | 0x10, 0x95, 0x37, 0xd9, 0xed, 0xee, 0xb4, 0x5d, 0x90, 0x11, 0xc8, 0xac, 0x84, 0x14, 0x81, 0x10, 113 | 0x16, 0x87, 0x2c, 0x94, 0x7f, 0x50, 0x50, 0xd1, 0x22, 0x01, 0x2b, 0x73, 0xe2, 0x14, 0x85, 0xc4, 114 | 0x59, 0x2c, 0x12, 0x4f, 0x64, 0xbb, 0x54, 0xed, 0xef, 0xe2, 0x87, 0x71, 0xe4, 0x88, 0x3c, 0x2c, 115 | 0xc9, 0xf6, 0xd2, 0xdb, 0x7c, 0x3c, 0x3f, 0xcf, 0x7b, 0x33, 0xf0, 0x32, 0x68, 0xeb, 0xd1, 0x35, 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0xde, 127 | 0x17, 0x73, 0xa3, 0xf9, 0x63, 0x98, 0x1b, 0x5f, 0x34, 0xc6, 0x96, 0xad, 0x38, 0xca, 0x98, 0x9c, 128 | 0xab, 0x23, 0xe3, 0x2f, 0x62, 0xca, 0x9f, 0xc1, 0x69, 0x85, 0x36, 0x38, 0x6c, 0x0b, 0x1a, 0x57, 129 | 0xcc, 0xb3, 0x44, 0x4e, 0xd5, 0xc9, 0xbe, 0x48, 0x6a, 0x56, 0x5f, 0x61, 0x31, 0xc8, 0xe2, 0xcf, 130 | 0x61, 0xd9, 0x3b, 0x5d, 0xe9, 0xda, 0xd8, 0x5d, 0xb1, 0xdf, 0x4a, 0xf4, 0xeb, 0x74, 0xa8, 0x92, 131 | 0xed, 0xb7, 0x60, 0x3d, 0xba, 0x40, 0x56, 0x1f, 0xc2, 0xb6, 0xe8, 0xc2, 0xea, 0x03, 0xc0, 0x28, 132 | 0x34, 0xee, 0x8a, 0xb4, 0x30, 0xd2, 0x42, 0x31, 0x97, 0x70, 0xbf, 0x6c, 0x4d, 0xe9, 0xff, 0xcd, 133 | 0x37, 0x52, 0x25, 0x6a, 0x49, 0x75, 0x9a, 0x2c, 0x72, 0x9d, 0xbf, 0x02, 0x81, 0x6e, 0x77, 0xe8, 134 | 0xea, 0x70, 0x6f, 0xe7, 0xf7, 0x06, 0x83, 0xb7, 0xf1, 0xdc, 0xfc, 0x96, 0xfd, 0x61, 0xec, 0xdb, 135 | 0x8c, 0x6e, 0xef, 0xcd, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa0, 0xd6, 0xb9, 0xf1, 0xa9, 0x02, 136 | 0x00, 0x00, 137 | } 138 | -------------------------------------------------------------------------------- /config/device_attributes.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. 2 | // source: tensorflow/core/framework/device_attributes.proto 3 | // DO NOT EDIT! 4 | 5 | package config 6 | 7 | import proto "github.com/golang/protobuf/proto" 8 | import fmt "fmt" 9 | import math "math" 10 | 11 | // Reference imports to suppress errors if they are not otherwise used. 12 | var _ = proto.Marshal 13 | var _ = fmt.Errorf 14 | var _ = math.Inf 15 | 16 | // BusAdjacency identifies the ability of a device to participate in 17 | // maximally efficient DMA operations within the local context of a 18 | // process. 19 | // 20 | // This is currently ignored. 21 | type BusAdjacency int32 22 | 23 | const ( 24 | BusAdjacency_BUS_0 BusAdjacency = 0 25 | BusAdjacency_BUS_1 BusAdjacency = 1 26 | BusAdjacency_BUS_ANY BusAdjacency = 2 27 | BusAdjacency_BUS_NUM_ADJACENCIES BusAdjacency = 3 28 | ) 29 | 30 | var BusAdjacency_name = map[int32]string{ 31 | 0: "BUS_0", 32 | 1: "BUS_1", 33 | 2: "BUS_ANY", 34 | 3: "BUS_NUM_ADJACENCIES", 35 | } 36 | var BusAdjacency_value = map[string]int32{ 37 | "BUS_0": 0, 38 | "BUS_1": 1, 39 | "BUS_ANY": 2, 40 | "BUS_NUM_ADJACENCIES": 3, 41 | } 42 | 43 | func (x BusAdjacency) String() string { 44 | return proto.EnumName(BusAdjacency_name, int32(x)) 45 | } 46 | func (BusAdjacency) EnumDescriptor() ([]byte, []int) { return fileDescriptor4, []int{0} } 47 | 48 | type DeviceAttributes struct { 49 | Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` 50 | // String representation of device_type. 51 | DeviceType string `protobuf:"bytes,2,opt,name=device_type,json=deviceType" json:"device_type,omitempty"` 52 | // Memory capacity of device in bytes. 53 | MemoryLimit int64 `protobuf:"varint,4,opt,name=memory_limit,json=memoryLimit" json:"memory_limit,omitempty"` 54 | BusAdjacency BusAdjacency `protobuf:"varint,5,opt,name=bus_adjacency,json=busAdjacency,enum=tensorflow.BusAdjacency" json:"bus_adjacency,omitempty"` 55 | // A device is assigned a global unique number each time it is 56 | // initialized. "incarnation" should never be 0. 57 | Incarnation uint64 `protobuf:"fixed64,6,opt,name=incarnation" json:"incarnation,omitempty"` 58 | // String representation of the physical device that this device maps to. 59 | PhysicalDeviceDesc string `protobuf:"bytes,7,opt,name=physical_device_desc,json=physicalDeviceDesc" json:"physical_device_desc,omitempty"` 60 | } 61 | 62 | func (m *DeviceAttributes) Reset() { *m = DeviceAttributes{} } 63 | func (m *DeviceAttributes) String() string { return proto.CompactTextString(m) } 64 | func (*DeviceAttributes) ProtoMessage() {} 65 | func (*DeviceAttributes) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{0} } 66 | 67 | func init() { 68 | proto.RegisterType((*DeviceAttributes)(nil), "tensorflow.DeviceAttributes") 69 | proto.RegisterEnum("tensorflow.BusAdjacency", BusAdjacency_name, BusAdjacency_value) 70 | } 71 | 72 | func init() { proto.RegisterFile("tensorflow/core/framework/device_attributes.proto", fileDescriptor4) } 73 | 74 | var fileDescriptor4 = []byte{ 75 | // 323 bytes of a gzipped FileDescriptorProto 76 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x5c, 0x51, 0xbb, 0x4f, 0xfb, 0x30, 77 | 0x18, 0xfc, 0xb9, 0x4f, 0xf5, 0x4b, 0x7f, 0x28, 0x32, 0x08, 0xbc, 0x11, 0x98, 0x22, 0x86, 0x3e, 78 | 0x60, 0x60, 0x62, 0x48, 0xda, 0x0e, 0x54, 0x50, 0x55, 0x29, 0x1d, 0x98, 0x22, 0xc7, 0x75, 0xc1, 79 | 0xd0, 0xc4, 0x91, 0xed, 0x52, 0xe5, 0x3f, 0x67, 0x41, 0x42, 0x49, 0x5f, 0x11, 0xdb, 0x7d, 0x77, 80 | 0x9f, 0xed, 0x3b, 0x1f, 0xf4, 0x0d, 0x4f, 0xb4, 0x54, 0xcb, 0x95, 0xdc, 0x74, 0x99, 0x54, 0xbc, 81 | 0xbb, 0x54, 0x34, 0xe6, 0x1b, 0xa9, 0x3e, 0xbb, 0x0b, 0xfe, 0x25, 0x18, 0x0f, 0xa9, 0x31, 0x4a, 82 | 0x44, 0x6b, 0xc3, 0x75, 0x27, 0x55, 0xd2, 0x48, 0x0c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f0, 0x38, 0x9a, 0xd9, 0x55, 0xff, 0x1e, 0x88, 0x54, 94 | 0x6f, 0xe5, 0x30, 0x87, 0x2e, 0xfc, 0xf3, 0xbf, 0x9f, 0x3c, 0xcd, 0xab, 0xd0, 0x53, 0xf4, 0x8d, 95 | 0x50, 0xd4, 0x28, 0x7a, 0xb9, 0xfb, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x08, 0x25, 0x86, 0x7f, 0xcc, 96 | 0x01, 0x00, 0x00, 97 | } 98 | -------------------------------------------------------------------------------- /config/function.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. 2 | // source: tensorflow/core/framework/function.proto 3 | // DO NOT EDIT! 4 | 5 | package config 6 | 7 | import proto "github.com/golang/protobuf/proto" 8 | import fmt "fmt" 9 | import math "math" 10 | 11 | // Reference imports to suppress errors if they are not otherwise used. 12 | var _ = proto.Marshal 13 | var _ = fmt.Errorf 14 | var _ = math.Inf 15 | 16 | // A library is a set of named functions. 17 | type FunctionDefLibrary struct { 18 | Function []*FunctionDef `protobuf:"bytes,1,rep,name=function" json:"function,omitempty"` 19 | Gradient []*GradientDef `protobuf:"bytes,2,rep,name=gradient" json:"gradient,omitempty"` 20 | } 21 | 22 | func (m *FunctionDefLibrary) Reset() { *m = FunctionDefLibrary{} } 23 | func (m *FunctionDefLibrary) String() string { return proto.CompactTextString(m) } 24 | func (*FunctionDefLibrary) ProtoMessage() {} 25 | func (*FunctionDefLibrary) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{0} } 26 | 27 | func (m *FunctionDefLibrary) GetFunction() []*FunctionDef { 28 | if m != nil { 29 | return m.Function 30 | } 31 | return nil 32 | } 33 | 34 | func (m *FunctionDefLibrary) GetGradient() []*GradientDef { 35 | if m != nil { 36 | return m.Gradient 37 | } 38 | return nil 39 | } 40 | 41 | // A function can be instantiated when the runtime can bind every attr 42 | // with a value. When a GraphDef has a call to a function, it must 43 | // have binding for every attr defined in the signature. 44 | // 45 | // TODO(zhifengc): 46 | // * device spec, etc. 47 | type FunctionDef struct { 48 | // The definition of the function's name, arguments, return values, 49 | // attrs etc. 50 | Signature *OpDef `protobuf:"bytes,1,opt,name=signature" json:"signature,omitempty"` 51 | // The body of the function. 52 | Node []*FunctionDef_Node `protobuf:"bytes,2,rep,name=node" json:"node,omitempty"` 53 | } 54 | 55 | func (m *FunctionDef) Reset() { *m = FunctionDef{} } 56 | func (m *FunctionDef) String() string { return proto.CompactTextString(m) } 57 | func (*FunctionDef) ProtoMessage() {} 58 | func (*FunctionDef) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{1} } 59 | 60 | func (m *FunctionDef) GetSignature() *OpDef { 61 | if m != nil { 62 | return m.Signature 63 | } 64 | return nil 65 | } 66 | 67 | func (m *FunctionDef) GetNode() []*FunctionDef_Node { 68 | if m != nil { 69 | return m.Node 70 | } 71 | return nil 72 | } 73 | 74 | // A node is a multi-value assignment: 75 | // (ret[0], ret[1], ...) = func(arg[0], arg[1], ...) 76 | // 77 | // By convention, "func" is resolved by consulting with a user-defined 78 | // library first. If not resolved, "func" is assumed to be a builtin op. 79 | type FunctionDef_Node struct { 80 | // This node produces multiple outputs. They are named ret[0], 81 | // ret[1], ..., etc. 82 | // 83 | // REQUIRES: function.node.ret[*] are unique across all nodes. 84 | // REQUIRES: ret.size == func/op def's number of output args. 85 | Ret []string `protobuf:"bytes,1,rep,name=ret" json:"ret,omitempty"` 86 | // The op/function name. 87 | Op string `protobuf:"bytes,2,opt,name=op" json:"op,omitempty"` 88 | // Arguments passed to this func/op. 89 | // 90 | // arg[i] must be either one of 91 | // function.signature.input_args[*].name or one of 92 | // function.node[*].ret[*]. 93 | // 94 | // REQUIRES: arg.size == func/op def's number of input args. 95 | Arg []string `protobuf:"bytes,3,rep,name=arg" json:"arg,omitempty"` 96 | // Control dependencies. 97 | // 98 | // dep[i] must be one of function.node[*].ret[*] or one of 99 | // function.signature.input_args[*].name. 100 | Dep []string `protobuf:"bytes,4,rep,name=dep" json:"dep,omitempty"` 101 | // Attrs. 102 | // 103 | // 'attr' maps names defined by 'func's attr defs to attr values. 104 | // attr values may have placeholders which are substituted 105 | // recursively by concrete values when this node is instantiated. 106 | // These placeholders must name an attr listed in the FunctionDef's 107 | // signature. 108 | Attr map[string]*AttrValue `protobuf:"bytes,5,rep,name=attr" json:"attr,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` 109 | } 110 | 111 | func (m *FunctionDef_Node) Reset() { *m = FunctionDef_Node{} } 112 | func (m *FunctionDef_Node) String() string { return proto.CompactTextString(m) } 113 | func (*FunctionDef_Node) ProtoMessage() {} 114 | func (*FunctionDef_Node) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{1, 0} } 115 | 116 | func (m *FunctionDef_Node) GetAttr() map[string]*AttrValue { 117 | if m != nil { 118 | return m.Attr 119 | } 120 | return nil 121 | } 122 | 123 | // GradientDef defines the gradient function of a function defined in 124 | // a function library. 125 | // 126 | // A gradient function g (specified by gradient_func) for a function f 127 | // (specified by function_name) must follow the following: 128 | // 129 | // The function 'f' must be a numerical function which takes N inputs 130 | // and produces M outputs. Its gradient function 'g', which is a 131 | // function taking N + M inputs and produces N outputs. 132 | // 133 | // I.e. if we have 134 | // (y1, y2, ..., y_M) = f(x1, x2, ..., x_N), 135 | // then, g is 136 | // (dL/dx1, dL/dx2, ..., dL/dx_N) = g(x1, x2, ..., x_N, 137 | // dL/dy1, dL/dy2, ..., dL/dy_M), 138 | // where L is a scalar-value function of (x1, x2, ..., xN) (e.g., the 139 | // loss function). dL/dx_i is the partial derivative of L with respect 140 | // to x_i. 141 | type GradientDef struct { 142 | FunctionName string `protobuf:"bytes,1,opt,name=function_name,json=functionName" json:"function_name,omitempty"` 143 | GradientFunc string `protobuf:"bytes,2,opt,name=gradient_func,json=gradientFunc" json:"gradient_func,omitempty"` 144 | } 145 | 146 | func (m *GradientDef) Reset() { *m = GradientDef{} } 147 | func (m *GradientDef) String() string { return proto.CompactTextString(m) } 148 | func (*GradientDef) ProtoMessage() {} 149 | func (*GradientDef) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{2} } 150 | 151 | func init() { 152 | proto.RegisterType((*FunctionDefLibrary)(nil), "tensorflow.FunctionDefLibrary") 153 | proto.RegisterType((*FunctionDef)(nil), "tensorflow.FunctionDef") 154 | proto.RegisterType((*FunctionDef_Node)(nil), "tensorflow.FunctionDef.Node") 155 | proto.RegisterType((*GradientDef)(nil), "tensorflow.GradientDef") 156 | } 157 | 158 | func init() { proto.RegisterFile("tensorflow/core/framework/function.proto", fileDescriptor5) } 159 | 160 | var fileDescriptor5 = []byte{ 161 | // 397 bytes of a gzipped FileDescriptorProto 162 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x7c, 0x92, 0xcf, 0xab, 0xd3, 0x40, 163 | 0x10, 0xc7, 0xd9, 0x34, 0x4f, 0xcc, 0xe4, 0xf9, 0xd0, 0x05, 0x71, 0x09, 0x1e, 0x4a, 0x85, 0x47, 164 | 0x50, 0x48, 0xa4, 0xef, 0x22, 0xbd, 0x59, 0xfc, 0x71, 0x91, 0x5a, 0x72, 0xd0, 0x63, 0xd8, 0x36, 165 | 0x93, 0x10, 0xda, 0xee, 0x86, 0xe9, 0xd6, 0xd2, 0x8b, 0xff, 0xa0, 0xff, 0x80, 0x7f, 0x8a, 0x47, 166 | 0xd9, 0x4d, 0xd2, 0x06, 0xa4, 0xde, 0x92, 0x99, 0xcf, 0xf7, 0x3b, 0x33, 0x3b, 0x03, 0xb1, 0x41, 167 | 0xb5, 0xd7, 0x54, 0x6e, 0xf5, 0x31, 0x5d, 0x6b, 0xc2, 0xb4, 0x24, 0xb9, 0xc3, 0xa3, 0xa6, 0x4d, 168 | 0x5a, 0x1e, 0xd4, 0xda, 0xd4, 0x5a, 0x25, 0x0d, 0x69, 0xa3, 0x39, 0x5c, 0xc8, 0xe8, 0xf5, 0x75, 169 | 0x95, 0x34, 0x86, 0xf2, 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, 0xb2, 0xd6, 0x1b, 0x3c, 0xb9, 0xa1, 0x83, 0xcc, 0x7e, 0xf2, 0x37, 181 | 0x70, 0xe3, 0x76, 0xea, 0x3a, 0x0a, 0xa7, 0xcf, 0x87, 0xde, 0x56, 0xf7, 0xcd, 0x26, 0xb3, 0x96, 182 | 0x99, 0x79, 0xef, 0xd8, 0xe4, 0x3b, 0x84, 0x83, 0x67, 0xe6, 0xaf, 0xe0, 0x49, 0xbf, 0x9d, 0x5c, 183 | 0xc9, 0x1d, 0x76, 0xde, 0xb7, 0x7d, 0x70, 0x21, 0x77, 0x68, 0xa1, 0x7e, 0x1b, 0xb9, 0x4d, 0x74, 184 | 0xe3, 0xdf, 0xf6, 0x41, 0x3b, 0xc4, 0x3c, 0x05, 0xa1, 0xa9, 0x1a, 0xd6, 0x3f, 0xdf, 0xd3, 0xfc, 185 | 0xae, 0x1f, 0x73, 0x69, 0x2f, 0x6a, 0xbf, 0x64, 0x7f, 0x18, 0x5b, 0x3d, 0x72, 0xe7, 0xf5, 0xf0, 186 | 0x37, 0x00, 0x00, 0xff, 0xff, 0x90, 0x85, 0x02, 0xaf, 0xea, 0x02, 0x00, 0x00, 187 | } 188 | -------------------------------------------------------------------------------- /config/graph.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. 2 | // source: tensorflow/core/framework/graph.proto 3 | // DO NOT EDIT! 4 | 5 | package config 6 | 7 | import proto "github.com/golang/protobuf/proto" 8 | import fmt "fmt" 9 | import math "math" 10 | 11 | // Reference imports to suppress errors if they are not otherwise used. 12 | var _ = proto.Marshal 13 | var _ = fmt.Errorf 14 | var _ = math.Inf 15 | 16 | // Represents the graph of operations 17 | type GraphDef struct { 18 | Node []*NodeDef `protobuf:"bytes,1,rep,name=node" json:"node,omitempty"` 19 | // Compatibility versions of the graph. See core/public/version.h for version 20 | // history. The GraphDef version is distinct from the TensorFlow version, and 21 | // each release of TensorFlow will support a range of GraphDef versions. 22 | Versions *VersionDef `protobuf:"bytes,4,opt,name=versions" json:"versions,omitempty"` 23 | // Deprecated single version field; use versions above instead. Since all 24 | // GraphDef changes before "versions" was introduced were forward 25 | // compatible, this field is entirely ignored. 26 | Version int32 `protobuf:"varint,3,opt,name=version" json:"version,omitempty"` 27 | // EXPERIMENTAL. DO NOT USE OR DEPEND ON THIS YET. 28 | // 29 | // "library" provides user-defined functions. 30 | // 31 | // Naming: 32 | // * library.function.name are in a flat namespace. 33 | // NOTE: We may need to change it to be hierarchical to support 34 | // different orgs. E.g., 35 | // { "/google/nn", { ... }}, 36 | // { "/google/vision", { ... }} 37 | // { "/org_foo/module_bar", {...}} 38 | // map named_lib; 39 | // * If node[i].op is the name of one function in "library", 40 | // node[i] is deemed as a function call. Otherwise, node[i].op 41 | // must be a primitive operation supported by the runtime. 42 | // 43 | // 44 | // Function call semantics: 45 | // 46 | // * The callee may start execution as soon as some of its inputs 47 | // are ready. The caller may want to use Tuple() mechanism to 48 | // ensure all inputs are ready in the same time. 49 | // 50 | // * The consumer of return values may start executing as soon as 51 | // the return values the consumer depends on are ready. The 52 | // consumer may want to use Tuple() mechanism to ensure the 53 | // consumer does not start until all return values of the callee 54 | // function are ready. 55 | Library *FunctionDefLibrary `protobuf:"bytes,2,opt,name=library" json:"library,omitempty"` 56 | } 57 | 58 | func (m *GraphDef) Reset() { *m = GraphDef{} } 59 | func (m *GraphDef) String() string { return proto.CompactTextString(m) } 60 | func (*GraphDef) ProtoMessage() {} 61 | func (*GraphDef) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{0} } 62 | 63 | func (m *GraphDef) GetNode() []*NodeDef { 64 | if m != nil { 65 | return m.Node 66 | } 67 | return nil 68 | } 69 | 70 | func (m *GraphDef) GetVersions() *VersionDef { 71 | if m != nil { 72 | return m.Versions 73 | } 74 | return nil 75 | } 76 | 77 | func (m *GraphDef) GetLibrary() *FunctionDefLibrary { 78 | if m != nil { 79 | return m.Library 80 | } 81 | return nil 82 | } 83 | 84 | type NodeDef struct { 85 | // The name given to this operator. Used for naming inputs, 86 | // logging, visualization, etc. Unique within a single GraphDef. 87 | // Must match the regexp "[A-Za-z0-9.][A-Za-z0-9_./]*". 88 | Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` 89 | // The operation name. There may be custom parameters in attrs. 90 | // Op names starting with an underscore are reserved for internal use. 91 | Op string `protobuf:"bytes,2,opt,name=op" json:"op,omitempty"` 92 | // Each input is "node:src_output" with "node" being a string name and 93 | // "src_output" indicating which output tensor to use from "node". If 94 | // "src_output" is 0 the ":0" suffix can be omitted. Regular inputs 95 | // may optionally be followed by control inputs that have the format 96 | // "^node". 97 | Input []string `protobuf:"bytes,3,rep,name=input" json:"input,omitempty"` 98 | // A (possibly partial) specification for the device on which this 99 | // node should be placed. 100 | // The expected syntax for this string is as follows: 101 | // 102 | // DEVICE_SPEC ::= COLOCATED_NODE | PARTIAL_SPEC 103 | // 104 | // COLOCATED_NODE ::= "@" NODE_NAME // See NodeDef.name above. 105 | // PARTIAL_SPEC ::= ("/" CONSTRAINT) * 106 | // CONSTRAINT ::= ("job:" JOB_NAME) 107 | // | ("replica:" [1-9][0-9]*) 108 | // | ("task:" [1-9][0-9]*) 109 | // | ( ("gpu" | "cpu") ":" ([1-9][0-9]* | "*") ) 110 | // 111 | // Valid values for this string include: 112 | // * "@other/node" (colocate with "other/node") 113 | // * "/job:worker/replica:0/task:1/gpu:3" (full specification) 114 | // * "/job:worker/gpu:3" (partial specification) 115 | // * "" (no specification) 116 | // 117 | // If the constraints do not resolve to a single device (or if this 118 | // field is empty or not present), the runtime will attempt to 119 | // choose a device automatically. 120 | Device string `protobuf:"bytes,4,opt,name=device" json:"device,omitempty"` 121 | // Operation-specific graph-construction-time configuration. 122 | // Note that this should include all attrs defined in the 123 | // corresponding OpDef, including those with a value matching 124 | // the default -- this allows the default to change and makes 125 | // NodeDefs easier to interpret on their own. However, if 126 | // an attr with a default is not specified in this list, the 127 | // default will be used. 128 | // The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and 129 | // one of the names from the corresponding OpDef's attr field). 130 | // The values must have a type matching the corresponding OpDef 131 | // attr's type field. 132 | // TODO(josh11b): Add some examples here showing best practices. 133 | Attr map[string]*AttrValue `protobuf:"bytes,5,rep,name=attr" json:"attr,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` 134 | } 135 | 136 | func (m *NodeDef) Reset() { *m = NodeDef{} } 137 | func (m *NodeDef) String() string { return proto.CompactTextString(m) } 138 | func (*NodeDef) ProtoMessage() {} 139 | func (*NodeDef) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{1} } 140 | 141 | func (m *NodeDef) GetAttr() map[string]*AttrValue { 142 | if m != nil { 143 | return m.Attr 144 | } 145 | return nil 146 | } 147 | 148 | func init() { 149 | proto.RegisterType((*GraphDef)(nil), "tensorflow.GraphDef") 150 | proto.RegisterType((*NodeDef)(nil), "tensorflow.NodeDef") 151 | } 152 | 153 | func init() { proto.RegisterFile("tensorflow/core/framework/graph.proto", fileDescriptor6) } 154 | 155 | var fileDescriptor6 = []byte{ 156 | // 369 bytes of a gzipped FileDescriptorProto 157 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x84, 0x91, 0x5f, 0x4b, 0x32, 0x41, 158 | 0x14, 0xc6, 0x99, 0xfd, 0xa3, 0xee, 0x11, 0x5e, 0x5e, 0xa6, 0x92, 0x41, 0x2a, 0x16, 0x21, 0x5a, 159 | 0x2a, 0x56, 0xb2, 0x1b, 0xe9, 0x2e, 0xb1, 0xba, 0x09, 0x91, 0xb9, 0xf0, 0x36, 0x56, 0x9d, 0xb5, 160 | 0x45, 0x9d, 0x59, 0x66, 0x47, 0xc5, 0x4f, 0xd7, 0x37, 0xe9, 0x73, 0x74, 0x19, 0x33, 0xbb, 0xea, 161 | 0x5e, 0x24, 0xdd, 0x9d, 0x99, 0xf3, 0x3b, 0x0f, 0xe7, 0x39, 0x0f, 0x5c, 0x29, 0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0, 0x26, 0x3c, 173 | 0x5d, 0x29, 0x62, 0xfb, 0x76, 0xe0, 0xd1, 0xfc, 0x81, 0x1b, 0x50, 0x99, 0xb2, 0x75, 0x32, 0x61, 174 | 0xc6, 0x8f, 0x47, 0x8b, 0x17, 0xbe, 0x07, 0x47, 0xe7, 0x40, 0x5c, 0x73, 0x92, 0x8b, 0x5f, 0x4e, 175 | 0x12, 0x3e, 0x29, 0x25, 0x9f, 0xb9, 0x92, 0x5b, 0x6a, 0xd0, 0xe6, 0x00, 0xbc, 0xfd, 0x17, 0xfe, 176 | 0x0f, 0xf6, 0x9c, 0x6d, 0x8b, 0x85, 0x74, 0x89, 0x6f, 0xc1, 0x35, 0xa1, 0x16, 0x3e, 0xcf, 0xca, 177 | 0x92, 0x7a, 0x6e, 0xa4, 0x9b, 0x34, 0x67, 0x1e, 0xad, 0x2e, 0xea, 0xdd, 0x01, 0x11, 0x72, 0x56, 178 | 0xc6, 0xf6, 0x69, 0xf6, 0xea, 0x26, 0xbb, 0xa1, 0x8e, 0x32, 0x1b, 0xa2, 0x6f, 0x84, 0xc6, 0x15, 179 | 0x93, 0xeb, 0xc3, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1c, 0x8d, 0x55, 0x7b, 0x8c, 0x02, 0x00, 180 | 0x00, 181 | } 182 | -------------------------------------------------------------------------------- /config/kernel_def.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. 2 | // source: tensorflow/core/framework/kernel_def.proto 3 | // DO NOT EDIT! 4 | 5 | package config 6 | 7 | import proto "github.com/golang/protobuf/proto" 8 | import fmt "fmt" 9 | import math "math" 10 | 11 | // Reference imports to suppress errors if they are not otherwise used. 12 | var _ = proto.Marshal 13 | var _ = fmt.Errorf 14 | var _ = math.Inf 15 | 16 | type KernelDef struct { 17 | // Must match the name of an Op. 18 | Op string `protobuf:"bytes,1,opt,name=op" json:"op,omitempty"` 19 | // Type of device this kernel runs on. 20 | DeviceType string `protobuf:"bytes,2,opt,name=device_type,json=deviceType" json:"device_type,omitempty"` 21 | Constraint []*KernelDef_AttrConstraint `protobuf:"bytes,3,rep,name=constraint" json:"constraint,omitempty"` 22 | // Names of the Op's input_/output_args that reside in host memory 23 | // instead of device memory. 24 | HostMemoryArg []string `protobuf:"bytes,4,rep,name=host_memory_arg,json=hostMemoryArg" json:"host_memory_arg,omitempty"` 25 | // This allows experimental kernels to be registered for an op that 26 | // won't be used unless the user specifies a "_kernel" attr with 27 | // value matching this. 28 | Label string `protobuf:"bytes,5,opt,name=label" json:"label,omitempty"` 29 | } 30 | 31 | func (m *KernelDef) Reset() { *m = KernelDef{} } 32 | func (m *KernelDef) String() string { return proto.CompactTextString(m) } 33 | func (*KernelDef) ProtoMessage() {} 34 | func (*KernelDef) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{0} } 35 | 36 | func (m *KernelDef) GetConstraint() []*KernelDef_AttrConstraint { 37 | if m != nil { 38 | return m.Constraint 39 | } 40 | return nil 41 | } 42 | 43 | type KernelDef_AttrConstraint struct { 44 | // Name of an attr from the Op. 45 | Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` 46 | // A list of values that this kernel supports for this attr. 47 | // Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops. 48 | AllowedValues *AttrValue `protobuf:"bytes,2,opt,name=allowed_values,json=allowedValues" json:"allowed_values,omitempty"` 49 | } 50 | 51 | func (m *KernelDef_AttrConstraint) Reset() { *m = KernelDef_AttrConstraint{} } 52 | func (m *KernelDef_AttrConstraint) String() string { return proto.CompactTextString(m) } 53 | func (*KernelDef_AttrConstraint) ProtoMessage() {} 54 | func (*KernelDef_AttrConstraint) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{0, 0} } 55 | 56 | func (m *KernelDef_AttrConstraint) GetAllowedValues() *AttrValue { 57 | if m != nil { 58 | return m.AllowedValues 59 | } 60 | return nil 61 | } 62 | 63 | func init() { 64 | proto.RegisterType((*KernelDef)(nil), "tensorflow.KernelDef") 65 | proto.RegisterType((*KernelDef_AttrConstraint)(nil), "tensorflow.KernelDef.AttrConstraint") 66 | } 67 | 68 | func init() { proto.RegisterFile("tensorflow/core/framework/kernel_def.proto", fileDescriptor7) } 69 | 70 | var fileDescriptor7 = []byte{ 71 | // 296 bytes of a gzipped FileDescriptorProto 72 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x7c, 0x50, 0x41, 0x6b, 0xf2, 0x40, 73 | 0x10, 0x25, 0x51, 0x3f, 0x70, 0x44, 0x85, 0xe5, 0x2b, 0x2c, 0x5e, 0x2a, 0xa5, 0x14, 0xe9, 0x21, 74 | 0x16, 0x7b, 0xed, 0x45, 0xeb, 0xad, 0x14, 0x24, 0x94, 0x5e, 0xc3, 0xaa, 0x93, 0x54, 0xdc, 0x64, 75 | 0xc2, 0xec, 0xd6, 0x90, 0xff, 0xd3, 0x1f, 0xd9, 0x63, 0xc9, 0x46, 0x62, 0x7a, 0xe9, 0x6d, 0xe7, 76 | 0xcd, 0x7b, 0x6f, 0xe7, 0x3d, 0xb8, 0xb7, 0x98, 0x19, 0xe2, 0x58, 0x53, 0x31, 0xdf, 0x11, 0xe3, 77 | 0x3c, 0x66, 0x95, 0x62, 0x41, 0x7c, 0x9c, 0x1f, 0x91, 0x33, 0xd4, 0xd1, 0x1e, 0xe3, 0x20, 0x67, 78 | 0xb2, 0x24, 0xe0, 0xc2, 0x9d, 0xfc, 0xa1, 0x53, 0xd6, 0x72, 0x74, 0x52, 0xfa, 0x13, 0x6b, 0xdd, 79 | 0xcd, 0x97, 0x0f, 0xfd, 0x17, 0x67, 0xb6, 0xc6, 0x58, 0x8c, 0xc0, 0xa7, 0x5c, 0x7a, 0x53, 0x6f, 80 | 0xd6, 0x0f, 0x7d, 0xca, 0xc5, 0x35, 0x0c, 0xf6, 0x78, 0x3a, 0xec, 0x30, 0xb2, 0x65, 0x8e, 0xd2, 81 | 0x77, 0x0b, 0xa8, 0xa1, 0xb7, 0x32, 0x47, 0xb1, 0x06, 0xd8, 0x51, 0x66, 0x2c, 0xab, 0x43, 0x66, 82 | 0x65, 0x67, 0xda, 0x99, 0x0d, 0x16, 0xb7, 0xc1, 0xe5, 0xff, 0xa0, 0xf1, 0x0e, 0x96, 0xd6, 0xf2, 83 | 0x73, 0xc3, 0x0d, 0x5b, 0x3a, 0x71, 0x07, 0xe3, 0x0f, 0x32, 0x36, 0x4a, 0x31, 0x25, 0x2e, 0x23, 84 | 0xc5, 0x89, 0xec, 0x4e, 0x3b, 0xb3, 0x7e, 0x38, 0xac, 0xe0, 0x57, 0x87, 0x2e, 0x39, 0x11, 0xff, 85 | 0xa1, 0xa7, 0xd5, 0x16, 0xb5, 0xec, 0xb9, 0x43, 0xea, 0x61, 0xb2, 0x85, 0xd1, 0x6f, 0x6f, 0x21, 86 | 0xa0, 0x9b, 0xa9, 0x14, 0xcf, 0x41, 0xdc, 0x5b, 0x3c, 0xc1, 0x48, 0x69, 0x4d, 0x05, 0xee, 0xeb, 87 | 0xfc, 0xc6, 0xa5, 0x19, 0x2c, 0xae, 0xda, 0xd7, 0x56, 0x3e, 0xef, 0xd5, 0x36, 0x1c, 0x9e, 0xc9, 88 | 0x6e, 0x32, 0xab, 0x07, 0x90, 0xc4, 0x49, 0x9b, 0xda, 0x74, 0xba, 0x1a, 0x37, 0x19, 0x37, 0x55, 89 | 0xa5, 0x66, 0xe3, 0x7d, 0x7b, 0xde, 0xf6, 0x9f, 0xeb, 0xf7, 0xf1, 0x27, 0x00, 0x00, 0xff, 0xff, 90 | 0x4a, 0x74, 0xc9, 0xbe, 0xc5, 0x01, 0x00, 0x00, 91 | } 92 | -------------------------------------------------------------------------------- /config/log_memory.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. 2 | // source: tensorflow/core/framework/log_memory.proto 3 | // DO NOT EDIT! 4 | 5 | package config 6 | 7 | import proto "github.com/golang/protobuf/proto" 8 | import fmt "fmt" 9 | import math "math" 10 | 11 | // Reference imports to suppress errors if they are not otherwise used. 12 | var _ = proto.Marshal 13 | var _ = fmt.Errorf 14 | var _ = math.Inf 15 | 16 | type MemoryLogStep struct { 17 | // Process-unique step id. 18 | StepId int64 `protobuf:"varint,1,opt,name=step_id,json=stepId" json:"step_id,omitempty"` 19 | // Handle describing the feeds and fetches of the step. 20 | Handle string `protobuf:"bytes,2,opt,name=handle" json:"handle,omitempty"` 21 | } 22 | 23 | func (m *MemoryLogStep) Reset() { *m = MemoryLogStep{} } 24 | func (m *MemoryLogStep) String() string { return proto.CompactTextString(m) } 25 | func (*MemoryLogStep) ProtoMessage() {} 26 | func (*MemoryLogStep) Descriptor() ([]byte, []int) { return fileDescriptor8, []int{0} } 27 | 28 | type MemoryLogTensorAllocation struct { 29 | // Process-unique step id. 30 | StepId int64 `protobuf:"varint,1,opt,name=step_id,json=stepId" json:"step_id,omitempty"` 31 | // Name of the kernel making the allocation as set in GraphDef, 32 | // e.g., "affine2/weights/Assign". 33 | KernelName string `protobuf:"bytes,2,opt,name=kernel_name,json=kernelName" json:"kernel_name,omitempty"` 34 | // Allocated tensor details. 35 | Tensor *TensorDescription `protobuf:"bytes,3,opt,name=tensor" json:"tensor,omitempty"` 36 | } 37 | 38 | func (m *MemoryLogTensorAllocation) Reset() { *m = MemoryLogTensorAllocation{} } 39 | func (m *MemoryLogTensorAllocation) String() string { return proto.CompactTextString(m) } 40 | func (*MemoryLogTensorAllocation) ProtoMessage() {} 41 | func (*MemoryLogTensorAllocation) Descriptor() ([]byte, []int) { return fileDescriptor8, []int{1} } 42 | 43 | func (m *MemoryLogTensorAllocation) GetTensor() *TensorDescription { 44 | if m != nil { 45 | return m.Tensor 46 | } 47 | return nil 48 | } 49 | 50 | type MemoryLogTensorDeallocation struct { 51 | // Id of the tensor buffer being deallocated, used to match to a 52 | // corresponding allocation. 53 | AllocationId int64 `protobuf:"varint,1,opt,name=allocation_id,json=allocationId" json:"allocation_id,omitempty"` 54 | // Name of the allocator used. 55 | AllocatorName string `protobuf:"bytes,2,opt,name=allocator_name,json=allocatorName" json:"allocator_name,omitempty"` 56 | } 57 | 58 | func (m *MemoryLogTensorDeallocation) Reset() { *m = MemoryLogTensorDeallocation{} } 59 | func (m *MemoryLogTensorDeallocation) String() string { return proto.CompactTextString(m) } 60 | func (*MemoryLogTensorDeallocation) ProtoMessage() {} 61 | func (*MemoryLogTensorDeallocation) Descriptor() ([]byte, []int) { return fileDescriptor8, []int{2} } 62 | 63 | type MemoryLogTensorOutput struct { 64 | // Process-unique step id. 65 | StepId int64 `protobuf:"varint,1,opt,name=step_id,json=stepId" json:"step_id,omitempty"` 66 | // Name of the kernel producing an output as set in GraphDef, e.g., 67 | // "affine2/weights/Assign". 68 | KernelName string `protobuf:"bytes,2,opt,name=kernel_name,json=kernelName" json:"kernel_name,omitempty"` 69 | // Index of the output being set. 70 | Index int32 `protobuf:"varint,3,opt,name=index" json:"index,omitempty"` 71 | // Output tensor details. 72 | Tensor *TensorDescription `protobuf:"bytes,4,opt,name=tensor" json:"tensor,omitempty"` 73 | } 74 | 75 | func (m *MemoryLogTensorOutput) Reset() { *m = MemoryLogTensorOutput{} } 76 | func (m *MemoryLogTensorOutput) String() string { return proto.CompactTextString(m) } 77 | func (*MemoryLogTensorOutput) ProtoMessage() {} 78 | func (*MemoryLogTensorOutput) Descriptor() ([]byte, []int) { return fileDescriptor8, []int{3} } 79 | 80 | func (m *MemoryLogTensorOutput) GetTensor() *TensorDescription { 81 | if m != nil { 82 | return m.Tensor 83 | } 84 | return nil 85 | } 86 | 87 | type MemoryLogRawAllocation struct { 88 | // Process-unique step id. 89 | StepId int64 `protobuf:"varint,1,opt,name=step_id,json=stepId" json:"step_id,omitempty"` 90 | // Name of the operation making the allocation. 91 | Operation string `protobuf:"bytes,2,opt,name=operation" json:"operation,omitempty"` 92 | // Number of bytes in the allocation. 93 | NumBytes int64 `protobuf:"varint,3,opt,name=num_bytes,json=numBytes" json:"num_bytes,omitempty"` 94 | // Address of the allocation. 95 | Ptr uint64 `protobuf:"varint,4,opt,name=ptr" json:"ptr,omitempty"` 96 | // Id of the tensor buffer being allocated, used to match to a 97 | // corresponding deallocation. 98 | AllocationId int64 `protobuf:"varint,5,opt,name=allocation_id,json=allocationId" json:"allocation_id,omitempty"` 99 | // Name of the allocator used. 100 | AllocatorName string `protobuf:"bytes,6,opt,name=allocator_name,json=allocatorName" json:"allocator_name,omitempty"` 101 | } 102 | 103 | func (m *MemoryLogRawAllocation) Reset() { *m = MemoryLogRawAllocation{} } 104 | func (m *MemoryLogRawAllocation) String() string { return proto.CompactTextString(m) } 105 | func (*MemoryLogRawAllocation) ProtoMessage() {} 106 | func (*MemoryLogRawAllocation) Descriptor() ([]byte, []int) { return fileDescriptor8, []int{4} } 107 | 108 | type MemoryLogRawDeallocation struct { 109 | // Process-unique step id. 110 | StepId int64 `protobuf:"varint,1,opt,name=step_id,json=stepId" json:"step_id,omitempty"` 111 | // Name of the operation making the deallocation. 112 | Operation string `protobuf:"bytes,2,opt,name=operation" json:"operation,omitempty"` 113 | // Id of the tensor buffer being deallocated, used to match to a 114 | // corresponding allocation. 115 | AllocationId int64 `protobuf:"varint,3,opt,name=allocation_id,json=allocationId" json:"allocation_id,omitempty"` 116 | // Name of the allocator used. 117 | AllocatorName string `protobuf:"bytes,4,opt,name=allocator_name,json=allocatorName" json:"allocator_name,omitempty"` 118 | // True if the deallocation is queued and will be performed later, 119 | // e.g. for GPU lazy freeing of buffers. 120 | Deferred bool `protobuf:"varint,5,opt,name=deferred" json:"deferred,omitempty"` 121 | } 122 | 123 | func (m *MemoryLogRawDeallocation) Reset() { *m = MemoryLogRawDeallocation{} } 124 | func (m *MemoryLogRawDeallocation) String() string { return proto.CompactTextString(m) } 125 | func (*MemoryLogRawDeallocation) ProtoMessage() {} 126 | func (*MemoryLogRawDeallocation) Descriptor() ([]byte, []int) { return fileDescriptor8, []int{5} } 127 | 128 | func init() { 129 | proto.RegisterType((*MemoryLogStep)(nil), "tensorflow.MemoryLogStep") 130 | proto.RegisterType((*MemoryLogTensorAllocation)(nil), "tensorflow.MemoryLogTensorAllocation") 131 | proto.RegisterType((*MemoryLogTensorDeallocation)(nil), "tensorflow.MemoryLogTensorDeallocation") 132 | proto.RegisterType((*MemoryLogTensorOutput)(nil), "tensorflow.MemoryLogTensorOutput") 133 | proto.RegisterType((*MemoryLogRawAllocation)(nil), "tensorflow.MemoryLogRawAllocation") 134 | proto.RegisterType((*MemoryLogRawDeallocation)(nil), "tensorflow.MemoryLogRawDeallocation") 135 | } 136 | 137 | func init() { proto.RegisterFile("tensorflow/core/framework/log_memory.proto", fileDescriptor8) } 138 | 139 | var fileDescriptor8 = []byte{ 140 | // 419 bytes of a gzipped FileDescriptorProto 141 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xa4, 0x93, 0xdf, 0xae, 0xd2, 0x40, 142 | 0x10, 0xc6, 0xb3, 0x16, 0x2a, 0xcc, 0x11, 0x35, 0x1b, 0x3d, 0xd6, 0x73, 0x34, 0x92, 0x1a, 0x13, 143 | 0xe2, 0x05, 0x18, 0x8c, 0xf7, 0x4a, 0xb8, 0x21, 0x41, 0x25, 0xab, 0xf7, 0x4d, 0xa1, 0x43, 0x6d, 144 | 0x68, 0x77, 0x9b, 0xed, 0x36, 0xc8, 0x3b, 0xf8, 0x0c, 0xbe, 0x87, 0xaf, 0xe0, 0x13, 0x79, 0x69, 145 | 0xda, 0xad, 0xdd, 0xca, 0x9f, 0x04, 0x3d, 0x77, 0xfd, 0xa6, 0xb3, 0x33, 0xbf, 0x6f, 0x26, 0x03, 146 | 0x2f, 0x15, 0xf2, 0x4c, 0xc8, 0x75, 0x2c, 0xb6, 0xa3, 0x95, 0x90, 0x38, 0x5a, 0x4b, 0x3f, 0xc1, 147 | 0xad, 0x90, 0x9b, 0x51, 0x2c, 0x42, 0x2f, 0xc1, 0x44, 0xc8, 0xdd, 0x30, 0x95, 0x42, 0x09, 0x0a, 148 | 0x26, 0xf7, 0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x16, 0x3f, 0x09, 0x5c, 0xd6, 0x80, 0xcc, 0xdf, 0x9e, 0xb3, 0x97, 0x27, 0xd0, 0x15, 0x29, 160 | 0xca, 0x32, 0xab, 0xe2, 0x33, 0x01, 0x7a, 0x0d, 0x5d, 0x9e, 0x27, 0xde, 0x72, 0xa7, 0x30, 0x2b, 161 | 0x11, 0x2d, 0xd6, 0xe1, 0x79, 0x32, 0x29, 0x34, 0xbd, 0x0f, 0x56, 0xaa, 0x34, 0x62, 0x8b, 0x15, 162 | 0x9f, 0x87, 0xd3, 0x6e, 0x9f, 0x35, 0x6d, 0xfb, 0xd8, 0xb4, 0x7f, 0x10, 0x70, 0x9a, 0x66, 0xfe, 163 | 0x5a, 0xeb, 0x7f, 0xda, 0x39, 0xe0, 0xb3, 0xce, 0xe2, 0x6b, 0x1d, 0xe1, 0xa3, 0x57, 0xd0, 0x09, 164 | 0x70, 0x8d, 0x52, 0xa2, 0xb6, 0xd9, 0x61, 0xb5, 0x9e, 0xbc, 0x02, 0x47, 0xc8, 0xb0, 0xb9, 0xb4, 165 | 0xfa, 0x34, 0x27, 0xf7, 0xe6, 0x22, 0xd4, 0xbe, 0x16, 0xc5, 0x45, 0x66, 0x0b, 0xf2, 0x8b, 0x90, 166 | 0xa5, 0x5d, 0x9e, 0xe7, 0xeb, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x4e, 0xdc, 0x69, 0x9c, 0x0c, 167 | 0x04, 0x00, 0x00, 168 | } 169 | -------------------------------------------------------------------------------- /config/op_def.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. 2 | // source: tensorflow/core/framework/op_def.proto 3 | // DO NOT EDIT! 4 | 5 | package config 6 | 7 | import proto "github.com/golang/protobuf/proto" 8 | import fmt "fmt" 9 | import math "math" 10 | 11 | // Reference imports to suppress errors if they are not otherwise used. 12 | var _ = proto.Marshal 13 | var _ = fmt.Errorf 14 | var _ = math.Inf 15 | 16 | // Defines an operation. A NodeDef in a GraphDef specifies an Op by 17 | // using the "op" field which should match the name of a OpDef. 18 | type OpDef struct { 19 | // Op names starting with an underscore are reserved for internal use. 20 | // Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9_]*". 21 | Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` 22 | // Description of the input(s). 23 | InputArg []*OpDef_ArgDef `protobuf:"bytes,2,rep,name=input_arg,json=inputArg" json:"input_arg,omitempty"` 24 | // Description of the output(s). 25 | OutputArg []*OpDef_ArgDef `protobuf:"bytes,3,rep,name=output_arg,json=outputArg" json:"output_arg,omitempty"` 26 | Attr []*OpDef_AttrDef `protobuf:"bytes,4,rep,name=attr" json:"attr,omitempty"` 27 | // Optional deprecation based on GraphDef versions. 28 | Deprecation *OpDeprecation `protobuf:"bytes,8,opt,name=deprecation" json:"deprecation,omitempty"` 29 | // One-line human-readable description of what the Op does. 30 | Summary string `protobuf:"bytes,5,opt,name=summary" json:"summary,omitempty"` 31 | // Additional, longer human-readable description of what the Op does. 32 | Description string `protobuf:"bytes,6,opt,name=description" json:"description,omitempty"` 33 | // True if the operation is commutative ("op(a,b) == op(b,a)" for all inputs) 34 | IsCommutative bool `protobuf:"varint,18,opt,name=is_commutative,json=isCommutative" json:"is_commutative,omitempty"` 35 | // If is_aggregate is true, then this operation accepts N >= 2 36 | // inputs and produces 1 output all of the same type. Should be 37 | // associative and commutative, and produce output with the same 38 | // shape as the input. The optimizer may replace an aggregate op 39 | // taking input from multiple devices with a tree of aggregate ops 40 | // that aggregate locally within each device (and possibly within 41 | // groups of nearby devices) before communicating. 42 | // TODO(josh11b): Implement that optimization. 43 | IsAggregate bool `protobuf:"varint,16,opt,name=is_aggregate,json=isAggregate" json:"is_aggregate,omitempty"` 44 | // By default Ops may be moved between devices. Stateful ops should 45 | // either not be moved, or should only be moved if that state can also 46 | // be moved (e.g. via some sort of save / restore). 47 | // Stateful ops are guaranteed to never be optimized away by Common 48 | // Subexpression Elimination (CSE). 49 | IsStateful bool `protobuf:"varint,17,opt,name=is_stateful,json=isStateful" json:"is_stateful,omitempty"` 50 | // By default, all inputs to an Op must be initialized Tensors. Ops 51 | // that may initialize tensors for the first time should set this 52 | // field to true, to allow the Op to take an uninitialized Tensor as 53 | // input. 54 | AllowsUninitializedInput bool `protobuf:"varint,19,opt,name=allows_uninitialized_input,json=allowsUninitializedInput" json:"allows_uninitialized_input,omitempty"` 55 | } 56 | 57 | func (m *OpDef) Reset() { *m = OpDef{} } 58 | func (m *OpDef) String() string { return proto.CompactTextString(m) } 59 | func (*OpDef) ProtoMessage() {} 60 | func (*OpDef) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{0} } 61 | 62 | func (m *OpDef) GetInputArg() []*OpDef_ArgDef { 63 | if m != nil { 64 | return m.InputArg 65 | } 66 | return nil 67 | } 68 | 69 | func (m *OpDef) GetOutputArg() []*OpDef_ArgDef { 70 | if m != nil { 71 | return m.OutputArg 72 | } 73 | return nil 74 | } 75 | 76 | func (m *OpDef) GetAttr() []*OpDef_AttrDef { 77 | if m != nil { 78 | return m.Attr 79 | } 80 | return nil 81 | } 82 | 83 | func (m *OpDef) GetDeprecation() *OpDeprecation { 84 | if m != nil { 85 | return m.Deprecation 86 | } 87 | return nil 88 | } 89 | 90 | // For describing inputs and outputs. 91 | type OpDef_ArgDef struct { 92 | // Name for the input/output. Should match the regexp "[a-z][a-z0-9_]*". 93 | Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` 94 | // Human readable description. 95 | Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` 96 | // Describes the type of one or more tensors that are accepted/produced 97 | // by this input/output arg. The only legal combinations are: 98 | // * For a single tensor: either the "type" field is set or the 99 | // "type_attr" field is set to the name of an attr with type "type". 100 | // * For a sequence of tensors with the same type: the "number_attr" 101 | // field will be set to the name of an attr with type "int", and 102 | // either the "type" or "type_attr" field will be set as for 103 | // single tensors. 104 | // * For a sequence of tensors, the "type_list_attr" field will be set 105 | // to the name of an attr with type "list(type)". 106 | Type DataType `protobuf:"varint,3,opt,name=type,enum=tensorflow.DataType" json:"type,omitempty"` 107 | TypeAttr string `protobuf:"bytes,4,opt,name=type_attr,json=typeAttr" json:"type_attr,omitempty"` 108 | NumberAttr string `protobuf:"bytes,5,opt,name=number_attr,json=numberAttr" json:"number_attr,omitempty"` 109 | // If specified, attr must have type "list(type)", and none of 110 | // type, type_attr, and number_attr may be specified. 111 | TypeListAttr string `protobuf:"bytes,6,opt,name=type_list_attr,json=typeListAttr" json:"type_list_attr,omitempty"` 112 | // For inputs: if true, the inputs are required to be refs. 113 | // By default, inputs can be either refs or non-refs. 114 | // For outputs: if true, outputs are refs, otherwise they are not. 115 | IsRef bool `protobuf:"varint,16,opt,name=is_ref,json=isRef" json:"is_ref,omitempty"` 116 | } 117 | 118 | func (m *OpDef_ArgDef) Reset() { *m = OpDef_ArgDef{} } 119 | func (m *OpDef_ArgDef) String() string { return proto.CompactTextString(m) } 120 | func (*OpDef_ArgDef) ProtoMessage() {} 121 | func (*OpDef_ArgDef) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{0, 0} } 122 | 123 | // Description of the graph-construction-time configuration of this 124 | // Op. That is to say, this describes the attr fields that will 125 | // be specified in the NodeDef. 126 | type OpDef_AttrDef struct { 127 | // A descriptive name for the argument. May be used, e.g. by the 128 | // Python client, as a keyword argument name, and so should match 129 | // the regexp "[a-z][a-z0-9_]+". 130 | Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` 131 | // One of the type names from attr_value.proto ("string", "list(string)", 132 | // "int", etc.). 133 | Type string `protobuf:"bytes,2,opt,name=type" json:"type,omitempty"` 134 | // A reasonable default for this attribute if the user does not supply 135 | // a value. If not specified, the user must supply a value. 136 | DefaultValue *AttrValue `protobuf:"bytes,3,opt,name=default_value,json=defaultValue" json:"default_value,omitempty"` 137 | // Human-readable description. 138 | Description string `protobuf:"bytes,4,opt,name=description" json:"description,omitempty"` 139 | // For type == "int", this is a minimum value. For "list(___)" 140 | // types, this is the minimum length. 141 | HasMinimum bool `protobuf:"varint,5,opt,name=has_minimum,json=hasMinimum" json:"has_minimum,omitempty"` 142 | Minimum int64 `protobuf:"varint,6,opt,name=minimum" json:"minimum,omitempty"` 143 | // The set of allowed values. Has type that is the "list" version 144 | // of the "type" field above (uses the "list" field of AttrValue). 145 | // If type == "type" or "list(type)" above, then the "type" field 146 | // of "allowed_values.list" has the set of allowed DataTypes. 147 | // If type == "string" or "list(string)", then the "s" field of 148 | // "allowed_values.list" has the set of allowed strings. 149 | AllowedValues *AttrValue `protobuf:"bytes,7,opt,name=allowed_values,json=allowedValues" json:"allowed_values,omitempty"` 150 | } 151 | 152 | func (m *OpDef_AttrDef) Reset() { *m = OpDef_AttrDef{} } 153 | func (m *OpDef_AttrDef) String() string { return proto.CompactTextString(m) } 154 | func (*OpDef_AttrDef) ProtoMessage() {} 155 | func (*OpDef_AttrDef) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{0, 1} } 156 | 157 | func (m *OpDef_AttrDef) GetDefaultValue() *AttrValue { 158 | if m != nil { 159 | return m.DefaultValue 160 | } 161 | return nil 162 | } 163 | 164 | func (m *OpDef_AttrDef) GetAllowedValues() *AttrValue { 165 | if m != nil { 166 | return m.AllowedValues 167 | } 168 | return nil 169 | } 170 | 171 | // Information about version-dependent deprecation of an op 172 | type OpDeprecation struct { 173 | // First GraphDef version at which the op is disallowed. 174 | Version int32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"` 175 | // Explanation of why it was deprecated and what to use instead. 176 | Explanation string `protobuf:"bytes,2,opt,name=explanation" json:"explanation,omitempty"` 177 | } 178 | 179 | func (m *OpDeprecation) Reset() { *m = OpDeprecation{} } 180 | func (m *OpDeprecation) String() string { return proto.CompactTextString(m) } 181 | func (*OpDeprecation) ProtoMessage() {} 182 | func (*OpDeprecation) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{1} } 183 | 184 | // A collection of OpDefs 185 | type OpList struct { 186 | Op []*OpDef `protobuf:"bytes,1,rep,name=op" json:"op,omitempty"` 187 | } 188 | 189 | func (m *OpList) Reset() { *m = OpList{} } 190 | func (m *OpList) String() string { return proto.CompactTextString(m) } 191 | func (*OpList) ProtoMessage() {} 192 | func (*OpList) Descriptor() ([]byte, []int) { return fileDescriptor9, []int{2} } 193 | 194 | func (m *OpList) GetOp() []*OpDef { 195 | if m != nil { 196 | return m.Op 197 | } 198 | return nil 199 | } 200 | 201 | func init() { 202 | proto.RegisterType((*OpDef)(nil), "tensorflow.OpDef") 203 | proto.RegisterType((*OpDef_ArgDef)(nil), "tensorflow.OpDef.ArgDef") 204 | proto.RegisterType((*OpDef_AttrDef)(nil), "tensorflow.OpDef.AttrDef") 205 | proto.RegisterType((*OpDeprecation)(nil), "tensorflow.OpDeprecation") 206 | proto.RegisterType((*OpList)(nil), "tensorflow.OpList") 207 | } 208 | 209 | func init() { proto.RegisterFile("tensorflow/core/framework/op_def.proto", fileDescriptor9) } 210 | 211 | var fileDescriptor9 = []byte{ 212 | // 625 bytes of a gzipped FileDescriptorProto 213 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x84, 0x94, 0xcb, 0x6e, 0x13, 0x31, 214 | 0x14, 0x86, 0x35, 0xb9, 0xe7, 0x4c, 0x13, 0x51, 0x43, 0x25, 0x13, 0x16, 0x4d, 0x2b, 0x8a, 0x22, 215 | 0x2e, 0xa9, 0x54, 0x84, 0x90, 0xa0, 0x9b, 0x96, 0x6e, 0x10, 0xa0, 0x56, 0xc3, 0x65, 0x3b, 0x72, 216 | 0x13, 0xcf, 0xd4, 0x62, 0x66, 0x6c, 0xd9, 0x9e, 0x96, 0xf2, 0x04, 0xbc, 0x1c, 0x4f, 0xc1, 0x4b, 217 | 0xb0, 0x44, 0x3e, 0x9e, 0xb4, 0x43, 0x93, 0xc2, 0x2a, 0xf1, 0x39, 0xdf, 0xef, 0xf1, 0xff, 0xfb, 218 | 0x02, 0x8f, 0x2c, 0x2f, 0x8c, 0xd4, 0x49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 0x22, 0x9e, 0x8c, 0x7e, 0x34, 0xa0, 0x5b, 0x9d, 241 | 0x8c, 0x95, 0x36, 0x49, 0x65, 0xc2, 0xfb, 0xf3, 0xcb, 0x7d, 0x05, 0x83, 0x39, 0x4f, 0x58, 0x99, 242 | 0x59, 0x7f, 0x6d, 0xd0, 0x61, 0xb8, 0xb7, 0x51, 0x77, 0xe8, 0xe6, 0xfc, 0xe2, 0x9a, 0xd1, 0x5a, 243 | 0xc5, 0xe2, 0xe8, 0x66, 0x6c, 0xad, 0xe5, 0xd8, 0x36, 0x21, 0x3c, 0x63, 0x26, 0xce, 0x45, 0x21, 244 | 0xf2, 0x32, 0x47, 0xbf, 0xbd, 0x08, 0xce, 0x98, 0xf9, 0xe0, 0x2b, 0xee, 0xf4, 0x2d, 0x9a, 0xce, 245 | 0x68, 0x33, 0x5a, 0x0c, 0xc9, 0x3e, 0x0c, 0x71, 0x3b, 0xf9, 0xdc, 0x2f, 0xcc, 0xd0, 0xee, 0xbf, 246 | 0x56, 0x36, 0xa8, 0x60, 0x1c, 0x99, 0xed, 0x77, 0x30, 0xf8, 0xeb, 0xcc, 0xbb, 0x0f, 0x9d, 0x73, 247 | 0x6d, 0xdc, 0x3a, 0x5d, 0x24, 0xed, 0x68, 0x31, 0x74, 0x2e, 0xf8, 0x37, 0x95, 0xb1, 0x82, 0xd5, 248 | 0x37, 0xbf, 0x56, 0xda, 0x7e, 0x02, 0x9d, 0x63, 0xe5, 0xc2, 0x27, 0x5b, 0xd0, 0x90, 0x8a, 0x06, 249 | 0x78, 0x2d, 0xd7, 0x97, 0xae, 0x65, 0xd4, 0x90, 0xea, 0xf0, 0x29, 0x50, 0xa9, 0xd3, 0x7a, 0xef, 250 | 0xea, 0xc5, 0x39, 0x0c, 0x11, 0x3b, 0x71, 0x2f, 0x8e, 0x39, 0x09, 0x7e, 0x07, 0xc1, 0x69, 0x07, 251 | 0x9f, 0x9f, 0xe7, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x73, 0x62, 0xad, 0xd8, 0x07, 0x05, 0x00, 252 | 0x00, 253 | } 254 | -------------------------------------------------------------------------------- /config/step_stats.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. 2 | // source: tensorflow/core/framework/step_stats.proto 3 | // DO NOT EDIT! 4 | 5 | package config 6 | 7 | import proto "github.com/golang/protobuf/proto" 8 | import fmt "fmt" 9 | import math "math" 10 | 11 | // Reference imports to suppress errors if they are not otherwise used. 12 | var _ = proto.Marshal 13 | var _ = fmt.Errorf 14 | var _ = math.Inf 15 | 16 | type AllocatorMemoryUsed struct { 17 | AllocatorName string `protobuf:"bytes,1,opt,name=allocator_name,json=allocatorName" json:"allocator_name,omitempty"` 18 | TotalBytes int64 `protobuf:"varint,2,opt,name=total_bytes,json=totalBytes" json:"total_bytes,omitempty"` 19 | PeakBytes int64 `protobuf:"varint,3,opt,name=peak_bytes,json=peakBytes" json:"peak_bytes,omitempty"` 20 | } 21 | 22 | func (m *AllocatorMemoryUsed) Reset() { *m = AllocatorMemoryUsed{} } 23 | func (m *AllocatorMemoryUsed) String() string { return proto.CompactTextString(m) } 24 | func (*AllocatorMemoryUsed) ProtoMessage() {} 25 | func (*AllocatorMemoryUsed) Descriptor() ([]byte, []int) { return fileDescriptor10, []int{0} } 26 | 27 | // Output sizes recorded for a single execution of a graph node. 28 | type NodeOutput struct { 29 | Slot int32 `protobuf:"varint,1,opt,name=slot" json:"slot,omitempty"` 30 | TensorDescription *TensorDescription `protobuf:"bytes,3,opt,name=tensor_description,json=tensorDescription" json:"tensor_description,omitempty"` 31 | } 32 | 33 | func (m *NodeOutput) Reset() { *m = NodeOutput{} } 34 | func (m *NodeOutput) String() string { return proto.CompactTextString(m) } 35 | func (*NodeOutput) ProtoMessage() {} 36 | func (*NodeOutput) Descriptor() ([]byte, []int) { return fileDescriptor10, []int{1} } 37 | 38 | func (m *NodeOutput) GetTensorDescription() *TensorDescription { 39 | if m != nil { 40 | return m.TensorDescription 41 | } 42 | return nil 43 | } 44 | 45 | // Time/size stats recorded for a single execution of a graph node. 46 | type NodeExecStats struct { 47 | // TODO(tucker): Use some more compact form of node identity than 48 | // the full string name. Either all processes should agree on a 49 | // global id (cost_id?) for each node, or we should use a hash of 50 | // the name. 51 | NodeName string `protobuf:"bytes,1,opt,name=node_name,json=nodeName" json:"node_name,omitempty"` 52 | AllStartMicros int64 `protobuf:"varint,2,opt,name=all_start_micros,json=allStartMicros" json:"all_start_micros,omitempty"` 53 | OpStartRelMicros int64 `protobuf:"varint,3,opt,name=op_start_rel_micros,json=opStartRelMicros" json:"op_start_rel_micros,omitempty"` 54 | OpEndRelMicros int64 `protobuf:"varint,4,opt,name=op_end_rel_micros,json=opEndRelMicros" json:"op_end_rel_micros,omitempty"` 55 | AllEndRelMicros int64 `protobuf:"varint,5,opt,name=all_end_rel_micros,json=allEndRelMicros" json:"all_end_rel_micros,omitempty"` 56 | Memory []*AllocatorMemoryUsed `protobuf:"bytes,6,rep,name=memory" json:"memory,omitempty"` 57 | Output []*NodeOutput `protobuf:"bytes,7,rep,name=output" json:"output,omitempty"` 58 | TimelineLabel string `protobuf:"bytes,8,opt,name=timeline_label,json=timelineLabel" json:"timeline_label,omitempty"` 59 | ScheduledMicros int64 `protobuf:"varint,9,opt,name=scheduled_micros,json=scheduledMicros" json:"scheduled_micros,omitempty"` 60 | ThreadId uint32 `protobuf:"varint,10,opt,name=thread_id,json=threadId" json:"thread_id,omitempty"` 61 | ReferencedTensor []*AllocationDescription `protobuf:"bytes,11,rep,name=referenced_tensor,json=referencedTensor" json:"referenced_tensor,omitempty"` 62 | } 63 | 64 | func (m *NodeExecStats) Reset() { *m = NodeExecStats{} } 65 | func (m *NodeExecStats) String() string { return proto.CompactTextString(m) } 66 | func (*NodeExecStats) ProtoMessage() {} 67 | func (*NodeExecStats) Descriptor() ([]byte, []int) { return fileDescriptor10, []int{2} } 68 | 69 | func (m *NodeExecStats) GetMemory() []*AllocatorMemoryUsed { 70 | if m != nil { 71 | return m.Memory 72 | } 73 | return nil 74 | } 75 | 76 | func (m *NodeExecStats) GetOutput() []*NodeOutput { 77 | if m != nil { 78 | return m.Output 79 | } 80 | return nil 81 | } 82 | 83 | func (m *NodeExecStats) GetReferencedTensor() []*AllocationDescription { 84 | if m != nil { 85 | return m.ReferencedTensor 86 | } 87 | return nil 88 | } 89 | 90 | type DeviceStepStats struct { 91 | Device string `protobuf:"bytes,1,opt,name=device" json:"device,omitempty"` 92 | NodeStats []*NodeExecStats `protobuf:"bytes,2,rep,name=node_stats,json=nodeStats" json:"node_stats,omitempty"` 93 | } 94 | 95 | func (m *DeviceStepStats) Reset() { *m = DeviceStepStats{} } 96 | func (m *DeviceStepStats) String() string { return proto.CompactTextString(m) } 97 | func (*DeviceStepStats) ProtoMessage() {} 98 | func (*DeviceStepStats) Descriptor() ([]byte, []int) { return fileDescriptor10, []int{3} } 99 | 100 | func (m *DeviceStepStats) GetNodeStats() []*NodeExecStats { 101 | if m != nil { 102 | return m.NodeStats 103 | } 104 | return nil 105 | } 106 | 107 | type StepStats struct { 108 | DevStats []*DeviceStepStats `protobuf:"bytes,1,rep,name=dev_stats,json=devStats" json:"dev_stats,omitempty"` 109 | } 110 | 111 | func (m *StepStats) Reset() { *m = StepStats{} } 112 | func (m *StepStats) String() string { return proto.CompactTextString(m) } 113 | func (*StepStats) ProtoMessage() {} 114 | func (*StepStats) Descriptor() ([]byte, []int) { return fileDescriptor10, []int{4} } 115 | 116 | func (m *StepStats) GetDevStats() []*DeviceStepStats { 117 | if m != nil { 118 | return m.DevStats 119 | } 120 | return nil 121 | } 122 | 123 | func init() { 124 | proto.RegisterType((*AllocatorMemoryUsed)(nil), "tensorflow.AllocatorMemoryUsed") 125 | proto.RegisterType((*NodeOutput)(nil), "tensorflow.NodeOutput") 126 | proto.RegisterType((*NodeExecStats)(nil), "tensorflow.NodeExecStats") 127 | proto.RegisterType((*DeviceStepStats)(nil), "tensorflow.DeviceStepStats") 128 | proto.RegisterType((*StepStats)(nil), "tensorflow.StepStats") 129 | } 130 | 131 | func init() { proto.RegisterFile("tensorflow/core/framework/step_stats.proto", fileDescriptor10) } 132 | 133 | var fileDescriptor10 = []byte{ 134 | // 562 bytes of a gzipped FileDescriptorProto 135 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x74, 0x53, 0x4d, 0x6f, 0xda, 0x40, 136 | 0x10, 0x95, 0xf3, 0x41, 0xf1, 0x20, 0x0a, 0x6c, 0xa4, 0xc8, 0x0d, 0x8a, 0x42, 0x91, 0x2a, 0x91, 137 | 0x56, 0x85, 0x8a, 0x4a, 0x6d, 0xae, 0x45, 0xe1, 0x50, 0x29, 0xa1, 0x91, 0x69, 0xcf, 0xd6, 0xe2, 138 | 0x1d, 0x1a, 0x2b, 0x6b, 0xaf, 0xb5, 0x5e, 0x48, 0x23, 0xf5, 0xda, 0xff, 0xdc, 0x63, 0xb5, 0x63, 139 | 0x83, 0x5d, 0x92, 0xdc, 0xc6, 0x6f, 0xdf, 0x3c, 0xbf, 0xd9, 0x79, 0x0b, 0x6f, 0x0d, 0x26, 0x99, 140 | 0xd2, 0x4b, 0xa9, 0xee, 0x47, 0xa1, 0xd2, 0x38, 0x5a, 0x6a, 0x1e, 0xe3, 0xbd, 0xd2, 0x77, 0xa3, 141 | 0xcc, 0x60, 0x1a, 0x64, 0x86, 0x9b, 0x6c, 0x98, 0x6a, 0x65, 0x14, 0x83, 0x92, 0x7b, 0xf2, 0xe9, 142 | 0xf9, 0x3e, 0x2e, 0xa5, 0x0a, 0xb9, 0x89, 0x54, 0x12, 0x08, 0xcc, 0x42, 0x1d, 0xa5, 0xb6, 0xce, 143 | 0x35, 0x4e, 0xc6, 0xcf, 0xf7, 0xe5, 0x27, 0x8f, 0x7b, 0xfa, 0xbf, 0xe1, 0xe8, 0x4b, 0xae, 0xa9, 144 | 0xf4, 0x35, 0xc6, 0x4a, 0x3f, 0xfc, 0xc8, 0x50, 0xb0, 0x37, 0x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0xc3, 0x0e, 0xf7, 0x90, 0xb8, 156 | 0x2d, 0x2e, 0xe5, 0x7f, 0xe4, 0xcf, 0x50, 0x8b, 0x69, 0x89, 0x5e, 0xad, 0xb7, 0x3f, 0x68, 0x8c, 157 | 0xcf, 0xaa, 0x37, 0xf4, 0xc4, 0x9e, 0xfd, 0x82, 0xce, 0x86, 0x50, 0x53, 0xb4, 0x04, 0xef, 0x05, 158 | 0x35, 0x1e, 0x57, 0x1b, 0xcb, 0x15, 0xf9, 0x05, 0xcb, 0xe6, 0xc3, 0x44, 0x31, 0xca, 0x28, 0xc1, 159 | 0x40, 0xf2, 0x05, 0x4a, 0xaf, 0x9e, 0xe7, 0x63, 0x83, 0x5e, 0x59, 0x90, 0x9d, 0x43, 0x3b, 0x0b, 160 | 0x6f, 0x51, 0xac, 0x24, 0x8a, 0x8d, 0x75, 0x37, 0xb7, 0xbe, 0xc5, 0x0b, 0xeb, 0x5d, 0x70, 0xcd, 161 | 0xad, 0x46, 0x2e, 0x82, 0x48, 0x78, 0xd0, 0x73, 0x06, 0x4d, 0xbf, 0x9e, 0x03, 0x5f, 0x05, 0x9b, 162 | 0x41, 0x47, 0xe3, 0x12, 0x35, 0x26, 0x21, 0x8a, 0x20, 0xb7, 0xe6, 0x35, 0xc8, 0xe9, 0xeb, 0x27, 163 | 0x46, 0x8c, 0x54, 0x52, 0x0d, 0x42, 0xbb, 0xec, 0xcd, 0x53, 0xd2, 0x0f, 0xa1, 0x75, 0x89, 0xeb, 164 | 0x28, 0xc4, 0xb9, 0xc1, 0x34, 0x0f, 0xc2, 0x31, 0xd4, 0x04, 0x41, 0x45, 0x0a, 0x8a, 0x2f, 0x76, 165 | 0x01, 0x40, 0x01, 0xa1, 0xc7, 0xea, 0xed, 0xd1, 0x3f, 0x5f, 0xed, 0xde, 0xce, 0x36, 0x4f, 0x3e, 166 | 0xa5, 0x89, 0xca, 0xfe, 0x14, 0xdc, 0x52, 0xfe, 0x02, 0x5c, 0x81, 0xeb, 0x42, 0xc5, 0x21, 0x95, 167 | 0x6e, 0x55, 0x65, 0xc7, 0x8e, 0x5f, 0x17, 0xb8, 0xa6, 0x6a, 0xf2, 0x01, 0x3c, 0xa5, 0x7f, 0x56, 168 | 0xb9, 0xdb, 0x67, 0x3d, 0x69, 0x6d, 0x1b, 0x6e, 0xec, 0x6b, 0xce, 0x6e, 0x9c, 0xbf, 0x8e, 0xb3, 169 | 0xa8, 0xd1, 0xd3, 0xfe, 0xf8, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x9b, 0x01, 0xc5, 0x6d, 0x80, 0x04, 170 | 0x00, 0x00, 171 | } 172 | -------------------------------------------------------------------------------- /config/summary.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. 2 | // source: tensorflow/core/framework/summary.proto 3 | // DO NOT EDIT! 4 | 5 | package config 6 | 7 | import proto "github.com/golang/protobuf/proto" 8 | import fmt "fmt" 9 | import math "math" 10 | 11 | // Reference imports to suppress errors if they are not otherwise used. 12 | var _ = proto.Marshal 13 | var _ = fmt.Errorf 14 | var _ = math.Inf 15 | 16 | // Serialization format for histogram module in 17 | // core/lib/histogram/histogram.h 18 | type HistogramProto struct { 19 | Min float64 `protobuf:"fixed64,1,opt,name=min" json:"min,omitempty"` 20 | Max float64 `protobuf:"fixed64,2,opt,name=max" json:"max,omitempty"` 21 | Num float64 `protobuf:"fixed64,3,opt,name=num" json:"num,omitempty"` 22 | Sum float64 `protobuf:"fixed64,4,opt,name=sum" json:"sum,omitempty"` 23 | SumSquares float64 `protobuf:"fixed64,5,opt,name=sum_squares,json=sumSquares" json:"sum_squares,omitempty"` 24 | // Parallel arrays encoding the bucket boundaries and the bucket values. 25 | // bucket(i) is the count for the bucket i. The range for 26 | // a bucket is: 27 | // i == 0: -DBL_MAX .. bucket_limit(0) 28 | // i != 0: bucket_limit(i-1) .. bucket_limit(i) 29 | BucketLimit []float64 `protobuf:"fixed64,6,rep,packed,name=bucket_limit,json=bucketLimit" json:"bucket_limit,omitempty"` 30 | Bucket []float64 `protobuf:"fixed64,7,rep,packed,name=bucket" json:"bucket,omitempty"` 31 | } 32 | 33 | func (m *HistogramProto) Reset() { *m = HistogramProto{} } 34 | func (m *HistogramProto) String() string { return proto.CompactTextString(m) } 35 | func (*HistogramProto) ProtoMessage() {} 36 | func (*HistogramProto) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{0} } 37 | 38 | // A Summary is a set of named values to be displayed by the 39 | // visualizer. 40 | // 41 | // Summaries are produced regularly during training, as controlled by 42 | // the "summary_interval_secs" attribute of the training operation. 43 | // Summaries are also produced at the end of an evaluation. 44 | type Summary struct { 45 | // Set of values for the summary. 46 | Value []*Summary_Value `protobuf:"bytes,1,rep,name=value" json:"value,omitempty"` 47 | } 48 | 49 | func (m *Summary) Reset() { *m = Summary{} } 50 | func (m *Summary) String() string { return proto.CompactTextString(m) } 51 | func (*Summary) ProtoMessage() {} 52 | func (*Summary) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{1} } 53 | 54 | func (m *Summary) GetValue() []*Summary_Value { 55 | if m != nil { 56 | return m.Value 57 | } 58 | return nil 59 | } 60 | 61 | type Summary_Image struct { 62 | // Dimensions of the image. 63 | Height int32 `protobuf:"varint,1,opt,name=height" json:"height,omitempty"` 64 | Width int32 `protobuf:"varint,2,opt,name=width" json:"width,omitempty"` 65 | // Valid colorspace values are 66 | // 1 - grayscale 67 | // 2 - grayscale + alpha 68 | // 3 - RGB 69 | // 4 - RGBA 70 | // 5 - DIGITAL_YUV 71 | // 6 - BGRA 72 | Colorspace int32 `protobuf:"varint,3,opt,name=colorspace" json:"colorspace,omitempty"` 73 | // Image data in encoded format. All image formats supported by 74 | // image_codec::CoderUtil can be stored here. 75 | EncodedImageString []byte `protobuf:"bytes,4,opt,name=encoded_image_string,json=encodedImageString,proto3" json:"encoded_image_string,omitempty"` 76 | } 77 | 78 | func (m *Summary_Image) Reset() { *m = Summary_Image{} } 79 | func (m *Summary_Image) String() string { return proto.CompactTextString(m) } 80 | func (*Summary_Image) ProtoMessage() {} 81 | func (*Summary_Image) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{1, 0} } 82 | 83 | type Summary_Audio struct { 84 | // Sample rate of the audio in Hz. 85 | SampleRate float32 `protobuf:"fixed32,1,opt,name=sample_rate,json=sampleRate" json:"sample_rate,omitempty"` 86 | // Number of channels of audio. 87 | NumChannels int64 `protobuf:"varint,2,opt,name=num_channels,json=numChannels" json:"num_channels,omitempty"` 88 | // Length of the audio in frames (samples per channel). 89 | LengthFrames int64 `protobuf:"varint,3,opt,name=length_frames,json=lengthFrames" json:"length_frames,omitempty"` 90 | // Encoded audio data and its associated RFC 2045 content type (e.g. 91 | // "audio/wav"). 92 | EncodedAudioString []byte `protobuf:"bytes,4,opt,name=encoded_audio_string,json=encodedAudioString,proto3" json:"encoded_audio_string,omitempty"` 93 | ContentType string `protobuf:"bytes,5,opt,name=content_type,json=contentType" json:"content_type,omitempty"` 94 | } 95 | 96 | func (m *Summary_Audio) Reset() { *m = Summary_Audio{} } 97 | func (m *Summary_Audio) String() string { return proto.CompactTextString(m) } 98 | func (*Summary_Audio) ProtoMessage() {} 99 | func (*Summary_Audio) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{1, 1} } 100 | 101 | type Summary_Value struct { 102 | // Name of the node that output this summary; in general, the name of a 103 | // TensorSummary node. If the node in question has multiple outputs, then 104 | // a ":\d+" suffix will be appended, like "some_op:13". 105 | // Might not be set for legacy summaries (i.e. those not using the tensor 106 | // value field) 107 | NodeName string `protobuf:"bytes,7,opt,name=node_name,json=nodeName" json:"node_name,omitempty"` 108 | // Tag name for the data. Will only be used by legacy summaries 109 | // (ie. those not using the tensor value field) 110 | // For legacy summaries, will be used as the title of the graph 111 | // in the visualizer. 112 | // 113 | // Tag is usually "op_name:value_name", where "op_name" itself can have 114 | // structure to indicate grouping. 115 | Tag string `protobuf:"bytes,1,opt,name=tag" json:"tag,omitempty"` 116 | // Value associated with the tag. 117 | // 118 | // Types that are valid to be assigned to Value: 119 | // *Summary_Value_SimpleValue 120 | // *Summary_Value_ObsoleteOldStyleHistogram 121 | // *Summary_Value_Image 122 | // *Summary_Value_Histo 123 | // *Summary_Value_Audio 124 | // *Summary_Value_Tensor 125 | Value isSummary_Value_Value `protobuf_oneof:"value"` 126 | } 127 | 128 | func (m *Summary_Value) Reset() { *m = Summary_Value{} } 129 | func (m *Summary_Value) String() string { return proto.CompactTextString(m) } 130 | func (*Summary_Value) ProtoMessage() {} 131 | func (*Summary_Value) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{1, 2} } 132 | 133 | type isSummary_Value_Value interface { 134 | isSummary_Value_Value() 135 | } 136 | 137 | type Summary_Value_SimpleValue struct { 138 | SimpleValue float32 `protobuf:"fixed32,2,opt,name=simple_value,json=simpleValue,oneof"` 139 | } 140 | type Summary_Value_ObsoleteOldStyleHistogram struct { 141 | ObsoleteOldStyleHistogram []byte `protobuf:"bytes,3,opt,name=obsolete_old_style_histogram,json=obsoleteOldStyleHistogram,proto3,oneof"` 142 | } 143 | type Summary_Value_Image struct { 144 | Image *Summary_Image `protobuf:"bytes,4,opt,name=image,oneof"` 145 | } 146 | type Summary_Value_Histo struct { 147 | Histo *HistogramProto `protobuf:"bytes,5,opt,name=histo,oneof"` 148 | } 149 | type Summary_Value_Audio struct { 150 | Audio *Summary_Audio `protobuf:"bytes,6,opt,name=audio,oneof"` 151 | } 152 | type Summary_Value_Tensor struct { 153 | Tensor *TensorProto `protobuf:"bytes,8,opt,name=tensor,oneof"` 154 | } 155 | 156 | func (*Summary_Value_SimpleValue) isSummary_Value_Value() {} 157 | func (*Summary_Value_ObsoleteOldStyleHistogram) isSummary_Value_Value() {} 158 | func (*Summary_Value_Image) isSummary_Value_Value() {} 159 | func (*Summary_Value_Histo) isSummary_Value_Value() {} 160 | func (*Summary_Value_Audio) isSummary_Value_Value() {} 161 | func (*Summary_Value_Tensor) isSummary_Value_Value() {} 162 | 163 | func (m *Summary_Value) GetValue() isSummary_Value_Value { 164 | if m != nil { 165 | return m.Value 166 | } 167 | return nil 168 | } 169 | 170 | func (m *Summary_Value) GetSimpleValue() float32 { 171 | if x, ok := m.GetValue().(*Summary_Value_SimpleValue); ok { 172 | return x.SimpleValue 173 | } 174 | return 0 175 | } 176 | 177 | func (m *Summary_Value) GetObsoleteOldStyleHistogram() []byte { 178 | if x, ok := m.GetValue().(*Summary_Value_ObsoleteOldStyleHistogram); ok { 179 | return x.ObsoleteOldStyleHistogram 180 | } 181 | return nil 182 | } 183 | 184 | func (m *Summary_Value) GetImage() *Summary_Image { 185 | if x, ok := m.GetValue().(*Summary_Value_Image); ok { 186 | return x.Image 187 | } 188 | return nil 189 | } 190 | 191 | func (m *Summary_Value) GetHisto() *HistogramProto { 192 | if x, ok := m.GetValue().(*Summary_Value_Histo); ok { 193 | return x.Histo 194 | } 195 | return nil 196 | } 197 | 198 | func (m *Summary_Value) GetAudio() *Summary_Audio { 199 | if x, ok := m.GetValue().(*Summary_Value_Audio); ok { 200 | return x.Audio 201 | } 202 | return nil 203 | } 204 | 205 | func (m *Summary_Value) GetTensor() *TensorProto { 206 | if x, ok := m.GetValue().(*Summary_Value_Tensor); ok { 207 | return x.Tensor 208 | } 209 | return nil 210 | } 211 | 212 | // XXX_OneofFuncs is for the internal use of the proto package. 213 | func (*Summary_Value) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { 214 | return _Summary_Value_OneofMarshaler, _Summary_Value_OneofUnmarshaler, _Summary_Value_OneofSizer, []interface{}{ 215 | (*Summary_Value_SimpleValue)(nil), 216 | (*Summary_Value_ObsoleteOldStyleHistogram)(nil), 217 | (*Summary_Value_Image)(nil), 218 | (*Summary_Value_Histo)(nil), 219 | (*Summary_Value_Audio)(nil), 220 | (*Summary_Value_Tensor)(nil), 221 | } 222 | } 223 | 224 | func _Summary_Value_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { 225 | m := msg.(*Summary_Value) 226 | // value 227 | switch x := m.Value.(type) { 228 | case *Summary_Value_SimpleValue: 229 | b.EncodeVarint(2<<3 | proto.WireFixed32) 230 | b.EncodeFixed32(uint64(math.Float32bits(x.SimpleValue))) 231 | case *Summary_Value_ObsoleteOldStyleHistogram: 232 | b.EncodeVarint(3<<3 | proto.WireBytes) 233 | b.EncodeRawBytes(x.ObsoleteOldStyleHistogram) 234 | case *Summary_Value_Image: 235 | b.EncodeVarint(4<<3 | proto.WireBytes) 236 | if err := b.EncodeMessage(x.Image); err != nil { 237 | return err 238 | } 239 | case *Summary_Value_Histo: 240 | b.EncodeVarint(5<<3 | proto.WireBytes) 241 | if err := b.EncodeMessage(x.Histo); err != nil { 242 | return err 243 | } 244 | case *Summary_Value_Audio: 245 | b.EncodeVarint(6<<3 | proto.WireBytes) 246 | if err := b.EncodeMessage(x.Audio); err != nil { 247 | return err 248 | } 249 | case *Summary_Value_Tensor: 250 | b.EncodeVarint(8<<3 | proto.WireBytes) 251 | if err := b.EncodeMessage(x.Tensor); err != nil { 252 | return err 253 | } 254 | case nil: 255 | default: 256 | return fmt.Errorf("Summary_Value.Value has unexpected type %T", x) 257 | } 258 | return nil 259 | } 260 | 261 | func _Summary_Value_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { 262 | m := msg.(*Summary_Value) 263 | switch tag { 264 | case 2: // value.simple_value 265 | if wire != proto.WireFixed32 { 266 | return true, proto.ErrInternalBadWireType 267 | } 268 | x, err := b.DecodeFixed32() 269 | m.Value = &Summary_Value_SimpleValue{math.Float32frombits(uint32(x))} 270 | return true, err 271 | case 3: // value.obsolete_old_style_histogram 272 | if wire != proto.WireBytes { 273 | return true, proto.ErrInternalBadWireType 274 | } 275 | x, err := b.DecodeRawBytes(true) 276 | m.Value = &Summary_Value_ObsoleteOldStyleHistogram{x} 277 | return true, err 278 | case 4: // value.image 279 | if wire != proto.WireBytes { 280 | return true, proto.ErrInternalBadWireType 281 | } 282 | msg := new(Summary_Image) 283 | err := b.DecodeMessage(msg) 284 | m.Value = &Summary_Value_Image{msg} 285 | return true, err 286 | case 5: // value.histo 287 | if wire != proto.WireBytes { 288 | return true, proto.ErrInternalBadWireType 289 | } 290 | msg := new(HistogramProto) 291 | err := b.DecodeMessage(msg) 292 | m.Value = &Summary_Value_Histo{msg} 293 | return true, err 294 | case 6: // value.audio 295 | if wire != proto.WireBytes { 296 | return true, proto.ErrInternalBadWireType 297 | } 298 | msg := new(Summary_Audio) 299 | err := b.DecodeMessage(msg) 300 | m.Value = &Summary_Value_Audio{msg} 301 | return true, err 302 | case 8: // value.tensor 303 | if wire != proto.WireBytes { 304 | return true, proto.ErrInternalBadWireType 305 | } 306 | msg := new(TensorProto) 307 | err := b.DecodeMessage(msg) 308 | m.Value = &Summary_Value_Tensor{msg} 309 | return true, err 310 | default: 311 | return false, nil 312 | } 313 | } 314 | 315 | func _Summary_Value_OneofSizer(msg proto.Message) (n int) { 316 | m := msg.(*Summary_Value) 317 | // value 318 | switch x := m.Value.(type) { 319 | case *Summary_Value_SimpleValue: 320 | n += proto.SizeVarint(2<<3 | proto.WireFixed32) 321 | n += 4 322 | case *Summary_Value_ObsoleteOldStyleHistogram: 323 | n += proto.SizeVarint(3<<3 | proto.WireBytes) 324 | n += proto.SizeVarint(uint64(len(x.ObsoleteOldStyleHistogram))) 325 | n += len(x.ObsoleteOldStyleHistogram) 326 | case *Summary_Value_Image: 327 | s := proto.Size(x.Image) 328 | n += proto.SizeVarint(4<<3 | proto.WireBytes) 329 | n += proto.SizeVarint(uint64(s)) 330 | n += s 331 | case *Summary_Value_Histo: 332 | s := proto.Size(x.Histo) 333 | n += proto.SizeVarint(5<<3 | proto.WireBytes) 334 | n += proto.SizeVarint(uint64(s)) 335 | n += s 336 | case *Summary_Value_Audio: 337 | s := proto.Size(x.Audio) 338 | n += proto.SizeVarint(6<<3 | proto.WireBytes) 339 | n += proto.SizeVarint(uint64(s)) 340 | n += s 341 | case *Summary_Value_Tensor: 342 | s := proto.Size(x.Tensor) 343 | n += proto.SizeVarint(8<<3 | proto.WireBytes) 344 | n += proto.SizeVarint(uint64(s)) 345 | n += s 346 | case nil: 347 | default: 348 | panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) 349 | } 350 | return n 351 | } 352 | 353 | func init() { 354 | proto.RegisterType((*HistogramProto)(nil), "tensorflow.HistogramProto") 355 | proto.RegisterType((*Summary)(nil), "tensorflow.Summary") 356 | proto.RegisterType((*Summary_Image)(nil), "tensorflow.Summary.Image") 357 | proto.RegisterType((*Summary_Audio)(nil), "tensorflow.Summary.Audio") 358 | proto.RegisterType((*Summary_Value)(nil), "tensorflow.Summary.Value") 359 | } 360 | 361 | func init() { proto.RegisterFile("tensorflow/core/framework/summary.proto", fileDescriptor11) } 362 | 363 | var fileDescriptor11 = []byte{ 364 | // 604 bytes of a gzipped FileDescriptorProto 365 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x74, 0x93, 0xcf, 0x6e, 0x13, 0x3b, 366 | 0x14, 0xc6, 0x3b, 0xc9, 0x9d, 0x49, 0x7b, 0x26, 0xbd, 0xaa, 0xac, 0xea, 0xde, 0x69, 0x40, 0x50, 367 | 0x5a, 0x01, 0x5d, 0x25, 0xb4, 0x3c, 0x41, 0x83, 0x84, 0x82, 0x84, 0xa0, 0x72, 0x2a, 0xb6, 0x23, 368 | 0x77, 0xe6, 0x74, 0x32, 0xea, 0xd8, 0x0e, 0x63, 0x9b, 0x36, 0x6b, 0x16, 0xbc, 0x14, 0x5b, 0xde, 369 | 0x88, 0x05, 0x4b, 0xe4, 0xe3, 0x69, 0x1b, 0x24, 0xba, 0xb3, 0x7f, 0xfe, 0x3e, 0x9f, 0x3f, 0x3e, 370 | 0x86, 0x97, 0x16, 0x95, 0xd1, 0xed, 0x65, 0xa3, 0xaf, 0x27, 0x85, 0x6e, 0x71, 0x72, 0xd9, 0x0a, 371 | 0x89, 0xd7, 0xba, 0xbd, 0x9a, 0x18, 0x27, 0xa5, 0x68, 0x57, 0xe3, 0x65, 0xab, 0xad, 0x66, 0x70, 372 | 0x2f, 0x1c, 0xbd, 0x78, 0xd8, 0x14, 0x4e, 0x82, 0xe7, 0xe0, 0x7b, 0x04, 0xff, 0xce, 0x6a, 0x63, 373 | 0x75, 0xd5, 0x0a, 0x79, 0x46, 0xd7, 0xec, 0x40, 0x5f, 0xd6, 0x2a, 0x8b, 0xf6, 0xa3, 0xa3, 0x88, 374 | 0xfb, 0x25, 0x11, 0x71, 0x93, 0xf5, 0x3a, 0x22, 0x6e, 0x3c, 0x51, 0x4e, 0x66, 0xfd, 0x40, 0x94, 375 | 0x93, 0x9e, 0x18, 0x27, 0xb3, 0x7f, 0x02, 0x31, 0x4e, 0xb2, 0xa7, 0x90, 0x1a, 0x27, 0x73, 0xf3, 376 | 0xd9, 0x89, 0x16, 0x4d, 0x16, 0xd3, 0x09, 0x18, 0x27, 0xe7, 0x81, 0xb0, 0xe7, 0x30, 0xbc, 0x70, 377 | 0xc5, 0x15, 0xda, 0xbc, 0xa9, 0x65, 0x6d, 0xb3, 0x64, 0xbf, 0x7f, 0x14, 0x4d, 0x7b, 0x3b, 0x11, 378 | 0x4f, 0x03, 0x7f, 0xef, 0x31, 0x1b, 0x41, 0x12, 0xb6, 0xd9, 0xe0, 0x4e, 0xd0, 0x91, 0x83, 0xaf, 379 | 0x09, 0x0c, 0xe6, 0xa1, 0x09, 0x6c, 0x02, 0xf1, 0x17, 0xd1, 0x38, 0xcc, 0xa2, 0xfd, 0xfe, 0x51, 380 | 0x7a, 0xb2, 0x37, 0xbe, 0x6f, 0xc1, 0xb8, 0xd3, 0x8c, 0x3f, 0x79, 0x01, 0x0f, 0xba, 0xd1, 0xb7, 381 | 0x08, 0xe2, 0x77, 0x52, 0x54, 0xc8, 0xfe, 0x83, 0x64, 0x81, 0x75, 0xb5, 0xb0, 0x54, 0x75, 0xcc, 382 | 0xbb, 0x1d, 0xdb, 0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68, 0x6a, 0x2a, 0x3b, 0x3c, 0xa1, 0xaf, 0xaa, 0x37, 0xdb, 0xe0, 0x69, 0xa0, 394 | 0xe1, 0xce, 0x53, 0x78, 0xac, 0x2f, 0x8c, 0x6e, 0xd0, 0x62, 0xae, 0x9b, 0x32, 0x37, 0x76, 0xd5, 395 | 0x60, 0xbe, 0xb8, 0x9d, 0x5e, 0x2a, 0x73, 0x38, 0xdb, 0xe0, 0x7b, 0xb7, 0xaa, 0x8f, 0x4d, 0x39, 396 | 0xf7, 0x9a, 0xbb, 0x01, 0x67, 0xc7, 0x10, 0xd3, 0x93, 0x50, 0x99, 0x0f, 0xcc, 0x08, 0x3d, 0xcc, 397 | 0x6c, 0x83, 0x07, 0x25, 0x3b, 0x81, 0x98, 0x42, 0x50, 0xbd, 0xe9, 0xc9, 0x68, 0xdd, 0xf2, 0xe7, 398 | 0xcf, 0xf1, 0x1e, 0x92, 0xfa, 0x30, 0xd4, 0xd4, 0x2c, 0x79, 0x38, 0x0c, 0xb5, 0xd6, 0x5b, 0x48, 399 | 0xc9, 0x8e, 0x21, 0x09, 0xa2, 0x6c, 0x93, 0x3c, 0xff, 0xaf, 0x7b, 0xce, 0x69, 0x79, 0x1b, 0xa4, 400 | 0x13, 0x4e, 0x07, 0xdd, 0xc0, 0x4f, 0xc7, 0x90, 0xe9, 0xb6, 0x5a, 0x37, 0xdc, 0xfd, 0xf6, 0xe9, 401 | 0x76, 0x17, 0x8f, 0xcc, 0xe6, 0x2c, 0xfa, 0x15, 0x45, 0x17, 0x09, 0xfd, 0xfd, 0xd7, 0xbf, 0x03, 402 | 0x00, 0x00, 0xff, 0xff, 0xf2, 0x04, 0xae, 0x21, 0x5a, 0x04, 0x00, 0x00, 403 | } 404 | -------------------------------------------------------------------------------- /config/tensor.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. 2 | // source: tensorflow/core/framework/tensor.proto 3 | // DO NOT EDIT! 4 | 5 | package config 6 | 7 | import proto "github.com/golang/protobuf/proto" 8 | import fmt "fmt" 9 | import math "math" 10 | 11 | // Reference imports to suppress errors if they are not otherwise used. 12 | var _ = proto.Marshal 13 | var _ = fmt.Errorf 14 | var _ = math.Inf 15 | 16 | // Protocol buffer representing a tensor. 17 | type TensorProto struct { 18 | Dtype DataType `protobuf:"varint,1,opt,name=dtype,enum=tensorflow.DataType" json:"dtype,omitempty"` 19 | // Shape of the tensor. TODO(touts): sort out the 0-rank issues. 20 | TensorShape *TensorShapeProto `protobuf:"bytes,2,opt,name=tensor_shape,json=tensorShape" json:"tensor_shape,omitempty"` 21 | // Version number. 22 | // 23 | // In version 0, if the "repeated xxx" representations contain only one 24 | // element, that element is repeated to fill the shape. This makes it easy 25 | // to represent a constant Tensor with a single value. 26 | VersionNumber int32 `protobuf:"varint,3,opt,name=version_number,json=versionNumber" json:"version_number,omitempty"` 27 | // Serialized content from Tensor::AsProtoTensorContent(). This representation 28 | // can be used for all tensor types. 29 | TensorContent []byte `protobuf:"bytes,4,opt,name=tensor_content,json=tensorContent,proto3" json:"tensor_content,omitempty"` 30 | // DT_HALF. Note that since protobuf has no int16 type, we'll have some 31 | // pointless zero padding for each value here. 32 | HalfVal []int32 `protobuf:"varint,13,rep,packed,name=half_val,json=halfVal" json:"half_val,omitempty"` 33 | // DT_FLOAT. 34 | FloatVal []float32 `protobuf:"fixed32,5,rep,packed,name=float_val,json=floatVal" json:"float_val,omitempty"` 35 | // DT_DOUBLE. 36 | DoubleVal []float64 `protobuf:"fixed64,6,rep,packed,name=double_val,json=doubleVal" json:"double_val,omitempty"` 37 | // DT_INT32, DT_INT16, DT_INT8, DT_UINT8. 38 | IntVal []int32 `protobuf:"varint,7,rep,packed,name=int_val,json=intVal" json:"int_val,omitempty"` 39 | // DT_STRING 40 | StringVal [][]byte `protobuf:"bytes,8,rep,name=string_val,json=stringVal,proto3" json:"string_val,omitempty"` 41 | // DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real 42 | // and imaginary parts of i-th single precision complex. 43 | ScomplexVal []float32 `protobuf:"fixed32,9,rep,packed,name=scomplex_val,json=scomplexVal" json:"scomplex_val,omitempty"` 44 | // DT_INT64 45 | Int64Val []int64 `protobuf:"varint,10,rep,packed,name=int64_val,json=int64Val" json:"int64_val,omitempty"` 46 | // DT_BOOL 47 | BoolVal []bool `protobuf:"varint,11,rep,packed,name=bool_val,json=boolVal" json:"bool_val,omitempty"` 48 | // DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real 49 | // and imaginary parts of i-th double precision complex. 50 | DcomplexVal []float64 `protobuf:"fixed64,12,rep,packed,name=dcomplex_val,json=dcomplexVal" json:"dcomplex_val,omitempty"` 51 | } 52 | 53 | func (m *TensorProto) Reset() { *m = TensorProto{} } 54 | func (m *TensorProto) String() string { return proto.CompactTextString(m) } 55 | func (*TensorProto) ProtoMessage() {} 56 | func (*TensorProto) Descriptor() ([]byte, []int) { return fileDescriptor12, []int{0} } 57 | 58 | func (m *TensorProto) GetTensorShape() *TensorShapeProto { 59 | if m != nil { 60 | return m.TensorShape 61 | } 62 | return nil 63 | } 64 | 65 | func init() { 66 | proto.RegisterType((*TensorProto)(nil), "tensorflow.TensorProto") 67 | } 68 | 69 | func init() { proto.RegisterFile("tensorflow/core/framework/tensor.proto", fileDescriptor12) } 70 | 71 | var fileDescriptor12 = []byte{ 72 | // 385 bytes of a gzipped FileDescriptorProto 73 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x84, 0x92, 0xc1, 0x8b, 0xd4, 0x30, 74 | 0x14, 0xc6, 0xc9, 0xc4, 0x99, 0x69, 0x5f, 0x3b, 0x8b, 0x14, 0x0f, 0x65, 0x75, 0x31, 0x0a, 0x23, 75 | 0x41, 0x74, 0x06, 0x56, 0xf1, 0x2a, 0x8c, 0x9e, 0x65, 0xa9, 0x8b, 0xd7, 0x21, 0x9d, 0xa6, 0xbb, 76 | 0xc5, 0x4c, 0x52, 0xd2, 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cf, 0x77, 0xb3, 0xa7, 0xa4, 0x58, 0x7a, 0xf6, 0x43, 0xa8, 0xec, 0x25, 0xc4, 0xb5, 88 | 0x32, 0xc2, 0x61, 0x3e, 0x67, 0x94, 0xcf, 0x30, 0x8f, 0x10, 0x7a, 0xe1, 0x15, 0x40, 0x65, 0xee, 89 | 0x4a, 0x25, 0xd1, 0x58, 0x30, 0xca, 0x09, 0x1a, 0x71, 0xa0, 0x5e, 0x79, 0x0e, 0xcb, 0x46, 0x87, 90 | 0x0d, 0xcb, 0xa1, 0x61, 0xd1, 0x68, 0x9c, 0xbf, 0x00, 0xe8, 0x9c, 0x6d, 0xf4, 0x0d, 0xe6, 0x11, 91 | 0xa3, 0x3c, 0x2d, 0xe2, 0x40, 0x7c, 0xbc, 0x86, 0xb4, 0x3b, 0x98, 0x63, 0xab, 0xe4, 0x2f, 0x14, 92 | 0xe2, 0xe1, 0x09, 0xc9, 0x3f, 0xde, 0x3f, 0xb3, 0xd1, 0xee, 0xd3, 0x47, 0x74, 0x80, 0x51, 0x4e, 93 | 0xc3, 0x33, 0x11, 0x86, 0x9a, 0xa8, 0x34, 0x46, 0x61, 0x9e, 0x30, 0xca, 0xa3, 0xf0, 0x99, 0x9e, 94 | 0xf5, 0x35, 0xd5, 0xb4, 0x26, 0x1d, 0xbe, 0x23, 0xa9, 0xc6, 0x9a, 0xdd, 0x7b, 0xc8, 0x8d, 0xbd, 95 | 0x99, 0xfe, 0xaa, 0xe1, 0x3e, 0x76, 0xe9, 0xe4, 0x20, 0xba, 0x2b, 0xf2, 0x87, 0x90, 0x72, 0x81, 96 | 0xd7, 0xf2, 0xe1, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xec, 0x30, 0x09, 0x1f, 0xb8, 0x02, 0x00, 97 | 0x00, 98 | } 99 | -------------------------------------------------------------------------------- /config/tensor_description.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. 2 | // source: tensorflow/core/framework/tensor_description.proto 3 | // DO NOT EDIT! 4 | 5 | package config 6 | 7 | import proto "github.com/golang/protobuf/proto" 8 | import fmt "fmt" 9 | import math "math" 10 | 11 | // Reference imports to suppress errors if they are not otherwise used. 12 | var _ = proto.Marshal 13 | var _ = fmt.Errorf 14 | var _ = math.Inf 15 | 16 | type TensorDescription struct { 17 | // Data type of tensor elements 18 | Dtype DataType `protobuf:"varint,1,opt,name=dtype,enum=tensorflow.DataType" json:"dtype,omitempty"` 19 | // Shape of the tensor. 20 | Shape *TensorShapeProto `protobuf:"bytes,2,opt,name=shape" json:"shape,omitempty"` 21 | // Information about the size and allocator used for the data 22 | AllocationDescription *AllocationDescription `protobuf:"bytes,4,opt,name=allocation_description,json=allocationDescription" json:"allocation_description,omitempty"` 23 | } 24 | 25 | func (m *TensorDescription) Reset() { *m = TensorDescription{} } 26 | func (m *TensorDescription) String() string { return proto.CompactTextString(m) } 27 | func (*TensorDescription) ProtoMessage() {} 28 | func (*TensorDescription) Descriptor() ([]byte, []int) { return fileDescriptor13, []int{0} } 29 | 30 | func (m *TensorDescription) GetShape() *TensorShapeProto { 31 | if m != nil { 32 | return m.Shape 33 | } 34 | return nil 35 | } 36 | 37 | func (m *TensorDescription) GetAllocationDescription() *AllocationDescription { 38 | if m != nil { 39 | return m.AllocationDescription 40 | } 41 | return nil 42 | } 43 | 44 | func init() { 45 | proto.RegisterType((*TensorDescription)(nil), "tensorflow.TensorDescription") 46 | } 47 | 48 | func init() { 49 | proto.RegisterFile("tensorflow/core/framework/tensor_description.proto", fileDescriptor13) 50 | } 51 | 52 | var fileDescriptor13 = []byte{ 53 | // 234 bytes of a gzipped FileDescriptorProto 54 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x32, 0x2a, 0x49, 0xcd, 0x2b, 55 | 0xce, 0x2f, 0x4a, 0xcb, 0xc9, 0x2f, 0xd7, 0x4f, 0xce, 0x2f, 0x4a, 0xd5, 0x4f, 0x2b, 0x4a, 0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xa3, 0x8a, 0x03, 0x18, 0x7f, 0x30, 0x32, 0x26, 0xb1, 0x81, 0x03, 0xc4, 0x18, 0x10, 0x00, 0x00, 68 | 0xff, 0xff, 0x26, 0xb4, 0x9a, 0xb7, 0xdf, 0x01, 0x00, 0x00, 69 | } 70 | -------------------------------------------------------------------------------- /config/tensor_shape.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. 2 | // source: tensorflow/core/framework/tensor_shape.proto 3 | // DO NOT EDIT! 4 | 5 | package config 6 | 7 | import proto "github.com/golang/protobuf/proto" 8 | import fmt "fmt" 9 | import math "math" 10 | 11 | // Reference imports to suppress errors if they are not otherwise used. 12 | var _ = proto.Marshal 13 | var _ = fmt.Errorf 14 | var _ = math.Inf 15 | 16 | // Dimensions of a tensor. 17 | type TensorShapeProto struct { 18 | // Dimensions of the tensor, such as {"input", 30}, {"output", 40} 19 | // for a 30 x 40 2D tensor. If an entry has size -1, this 20 | // corresponds to a dimension of unknown size. The names are 21 | // optional. 22 | // 23 | // The order of entries in "dim" matters: It indicates the layout of the 24 | // values in the tensor in-memory representation. 25 | // 26 | // The first entry in "dim" is the outermost dimension used to layout the 27 | // values, the last entry is the innermost dimension. This matches the 28 | // in-memory layout of RowMajor Eigen tensors. 29 | // 30 | // If "dim.size()" > 0, "unknown_rank" must be false. 31 | Dim []*TensorShapeProto_Dim `protobuf:"bytes,2,rep,name=dim" json:"dim,omitempty"` 32 | // If true, the number of dimensions in the shape is unknown. 33 | // 34 | // If true, "dim.size()" must be 0. 35 | UnknownRank bool `protobuf:"varint,3,opt,name=unknown_rank,json=unknownRank" json:"unknown_rank,omitempty"` 36 | } 37 | 38 | func (m *TensorShapeProto) Reset() { *m = TensorShapeProto{} } 39 | func (m *TensorShapeProto) String() string { return proto.CompactTextString(m) } 40 | func (*TensorShapeProto) ProtoMessage() {} 41 | func (*TensorShapeProto) Descriptor() ([]byte, []int) { return fileDescriptor14, []int{0} } 42 | 43 | func (m *TensorShapeProto) GetDim() []*TensorShapeProto_Dim { 44 | if m != nil { 45 | return m.Dim 46 | } 47 | return nil 48 | } 49 | 50 | // One dimension of the tensor. 51 | type TensorShapeProto_Dim struct { 52 | // Size of the tensor in that dimension. 53 | // This value must be >= -1, but values of -1 are reserved for "unknown" 54 | // shapes (values of -1 mean "unknown" dimension). Certain wrappers 55 | // that work with TensorShapeProto may fail at runtime when deserializing 56 | // a TensorShapeProto containing a dim value of -1. 57 | Size int64 `protobuf:"varint,1,opt,name=size" json:"size,omitempty"` 58 | // Optional name of the tensor dimension. 59 | Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` 60 | } 61 | 62 | func (m *TensorShapeProto_Dim) Reset() { *m = TensorShapeProto_Dim{} } 63 | func (m *TensorShapeProto_Dim) String() string { return proto.CompactTextString(m) } 64 | func (*TensorShapeProto_Dim) ProtoMessage() {} 65 | func (*TensorShapeProto_Dim) Descriptor() ([]byte, []int) { return fileDescriptor14, []int{0, 0} } 66 | 67 | func init() { 68 | proto.RegisterType((*TensorShapeProto)(nil), "tensorflow.TensorShapeProto") 69 | proto.RegisterType((*TensorShapeProto_Dim)(nil), "tensorflow.TensorShapeProto.Dim") 70 | } 71 | 72 | func init() { proto.RegisterFile("tensorflow/core/framework/tensor_shape.proto", fileDescriptor14) } 73 | 74 | var fileDescriptor14 = []byte{ 75 | // 206 bytes of a gzipped FileDescriptorProto 76 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xd2, 0x29, 0x49, 0xcd, 0x2b, 77 | 0xce, 0x2f, 0x4a, 0xcb, 0xc9, 0x2f, 0xd7, 0x4f, 0xce, 0x2f, 0x4a, 0xd5, 0x4f, 0x2b, 0x4a, 0xcc, 78 | 0x4d, 0x2d, 0xcf, 0x2f, 0xca, 0xd6, 0x87, 0xc8, 0xc4, 0x17, 0x67, 0x24, 0x16, 0xa4, 0xea, 0x15, 79 | 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x71, 0x21, 0x54, 0x2b, 0xcd, 0x60, 0xe4, 0x12, 0x08, 0x01, 0x73, 80 | 0x83, 0x41, 0x2a, 0x02, 0xc0, 0x0a, 0x8c, 0xb8, 0x98, 0x53, 0x32, 0x73, 0x25, 0x98, 0x14, 0x98, 81 | 0x35, 0xb8, 0x8d, 0x14, 0xf4, 0x10, 0xca, 0xf5, 0xd0, 0x95, 0xea, 0xb9, 0x64, 0xe6, 0x06, 0x81, 82 | 0x14, 0x0b, 0x29, 0x72, 0xf1, 0x94, 0xe6, 0x65, 0xe7, 0xe5, 0x97, 0xe7, 0xc5, 0x17, 0x25, 0xe6, 83 | 0x65, 0x4b, 0x30, 0x2b, 0x30, 0x6a, 0x70, 0x04, 0x71, 0x43, 0xc5, 0x82, 0x12, 0xf3, 0xb2, 0xa5, 84 | 0x74, 0xb9, 0x98, 0x5d, 0x32, 0x73, 0x85, 0x84, 0xb8, 0x58, 0x8a, 0x33, 0xab, 0x52, 0x25, 0x18, 85 | 0x15, 0x18, 0x35, 0x98, 0x83, 0xc0, 0x6c, 0x90, 0x58, 0x5e, 0x62, 0x6e, 0xaa, 0x04, 0x93, 0x02, 86 | 0xa3, 0x06, 0x67, 0x10, 0x98, 0xed, 0x64, 0xc4, 0x25, 0x91, 0x5f, 0x94, 0x8e, 0x6c, 0x3b, 0xdc, 87 | 0x57, 0x4e, 0x82, 0xe8, 0x0e, 0x29, 0x0e, 0x60, 0xfc, 0xc1, 0xc8, 0x98, 0xc4, 0x06, 0xf6, 0xa1, 88 | 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x34, 0xe4, 0x72, 0x62, 0x11, 0x01, 0x00, 0x00, 89 | } 90 | -------------------------------------------------------------------------------- /config/tensor_slice.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. 2 | // source: tensorflow/core/framework/tensor_slice.proto 3 | // DO NOT EDIT! 4 | 5 | package config 6 | 7 | import proto "github.com/golang/protobuf/proto" 8 | import fmt "fmt" 9 | import math "math" 10 | 11 | // Reference imports to suppress errors if they are not otherwise used. 12 | var _ = proto.Marshal 13 | var _ = fmt.Errorf 14 | var _ = math.Inf 15 | 16 | // Can only be interpreted if you know the corresponding TensorShape. 17 | type TensorSliceProto struct { 18 | // Extent of the slice in all tensor dimensions. 19 | // 20 | // Must have one entry for each of the dimension of the tensor that this 21 | // slice belongs to. The order of sizes is the same as the order of 22 | // dimensions in the TensorShape. 23 | Extent []*TensorSliceProto_Extent `protobuf:"bytes,1,rep,name=extent" json:"extent,omitempty"` 24 | } 25 | 26 | func (m *TensorSliceProto) Reset() { *m = TensorSliceProto{} } 27 | func (m *TensorSliceProto) String() string { return proto.CompactTextString(m) } 28 | func (*TensorSliceProto) ProtoMessage() {} 29 | func (*TensorSliceProto) Descriptor() ([]byte, []int) { return fileDescriptor15, []int{0} } 30 | 31 | func (m *TensorSliceProto) GetExtent() []*TensorSliceProto_Extent { 32 | if m != nil { 33 | return m.Extent 34 | } 35 | return nil 36 | } 37 | 38 | // Extent of the slice in one dimension. 39 | type TensorSliceProto_Extent struct { 40 | // Start index of the slice, starting at 0. 41 | Start int64 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"` 42 | // Length of the slice: if the length is missing or -1 we will 43 | // interpret this as "everything in this dimension". We use 44 | // "oneof" to preserve information about whether the length is 45 | // present without changing the serialization format from the 46 | // prior proto2 version of this proto. 47 | // 48 | // Types that are valid to be assigned to HasLength: 49 | // *TensorSliceProto_Extent_Length 50 | HasLength isTensorSliceProto_Extent_HasLength `protobuf_oneof:"has_length"` 51 | } 52 | 53 | func (m *TensorSliceProto_Extent) Reset() { *m = TensorSliceProto_Extent{} } 54 | func (m *TensorSliceProto_Extent) String() string { return proto.CompactTextString(m) } 55 | func (*TensorSliceProto_Extent) ProtoMessage() {} 56 | func (*TensorSliceProto_Extent) Descriptor() ([]byte, []int) { return fileDescriptor15, []int{0, 0} } 57 | 58 | type isTensorSliceProto_Extent_HasLength interface { 59 | isTensorSliceProto_Extent_HasLength() 60 | } 61 | 62 | type TensorSliceProto_Extent_Length struct { 63 | Length int64 `protobuf:"varint,2,opt,name=length,oneof"` 64 | } 65 | 66 | func (*TensorSliceProto_Extent_Length) isTensorSliceProto_Extent_HasLength() {} 67 | 68 | func (m *TensorSliceProto_Extent) GetHasLength() isTensorSliceProto_Extent_HasLength { 69 | if m != nil { 70 | return m.HasLength 71 | } 72 | return nil 73 | } 74 | 75 | func (m *TensorSliceProto_Extent) GetLength() int64 { 76 | if x, ok := m.GetHasLength().(*TensorSliceProto_Extent_Length); ok { 77 | return x.Length 78 | } 79 | return 0 80 | } 81 | 82 | // XXX_OneofFuncs is for the internal use of the proto package. 83 | func (*TensorSliceProto_Extent) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { 84 | return _TensorSliceProto_Extent_OneofMarshaler, _TensorSliceProto_Extent_OneofUnmarshaler, _TensorSliceProto_Extent_OneofSizer, []interface{}{ 85 | (*TensorSliceProto_Extent_Length)(nil), 86 | } 87 | } 88 | 89 | func _TensorSliceProto_Extent_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { 90 | m := msg.(*TensorSliceProto_Extent) 91 | // has_length 92 | switch x := m.HasLength.(type) { 93 | case *TensorSliceProto_Extent_Length: 94 | b.EncodeVarint(2<<3 | proto.WireVarint) 95 | b.EncodeVarint(uint64(x.Length)) 96 | case nil: 97 | default: 98 | return fmt.Errorf("TensorSliceProto_Extent.HasLength has unexpected type %T", x) 99 | } 100 | return nil 101 | } 102 | 103 | func _TensorSliceProto_Extent_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { 104 | m := msg.(*TensorSliceProto_Extent) 105 | switch tag { 106 | case 2: // has_length.length 107 | if wire != proto.WireVarint { 108 | return true, proto.ErrInternalBadWireType 109 | } 110 | x, err := b.DecodeVarint() 111 | m.HasLength = &TensorSliceProto_Extent_Length{int64(x)} 112 | return true, err 113 | default: 114 | return false, nil 115 | } 116 | } 117 | 118 | func _TensorSliceProto_Extent_OneofSizer(msg proto.Message) (n int) { 119 | m := msg.(*TensorSliceProto_Extent) 120 | // has_length 121 | switch x := m.HasLength.(type) { 122 | case *TensorSliceProto_Extent_Length: 123 | n += proto.SizeVarint(2<<3 | proto.WireVarint) 124 | n += proto.SizeVarint(uint64(x.Length)) 125 | case nil: 126 | default: 127 | panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) 128 | } 129 | return n 130 | } 131 | 132 | func init() { 133 | proto.RegisterType((*TensorSliceProto)(nil), "tensorflow.TensorSliceProto") 134 | proto.RegisterType((*TensorSliceProto_Extent)(nil), "tensorflow.TensorSliceProto.Extent") 135 | } 136 | 137 | func init() { proto.RegisterFile("tensorflow/core/framework/tensor_slice.proto", fileDescriptor15) } 138 | 139 | var fileDescriptor15 = []byte{ 140 | // 190 bytes of a gzipped FileDescriptorProto 141 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xd2, 0x29, 0x49, 0xcd, 0x2b, 142 | 0xce, 0x2f, 0x4a, 0xcb, 0xc9, 0x2f, 0xd7, 0x4f, 0xce, 0x2f, 0x4a, 0xd5, 0x4f, 0x2b, 0x4a, 0xcc, 143 | 0x4d, 0x2d, 0xcf, 0x2f, 0xca, 0xd6, 0x87, 0xc8, 0xc4, 0x17, 0xe7, 0x64, 0x26, 0xa7, 0xea, 0x15, 144 | 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x71, 0x21, 0x54, 0x2b, 0x4d, 0x67, 0xe4, 0x12, 0x08, 0x01, 0x73, 145 | 0x83, 0x41, 0x2a, 0x02, 0xc0, 0x0a, 0xac, 0xb9, 0xd8, 0x52, 0x2b, 0x4a, 0x52, 0xf3, 0x4a, 0x24, 146 | 0x18, 0x15, 0x98, 0x35, 0xb8, 0x8d, 0x94, 0xf5, 0x10, 0x3a, 0xf4, 0xd0, 0x55, 0xeb, 0xb9, 0x82, 147 | 0x95, 0x06, 0x41, 0xb5, 0x48, 0xb9, 0x71, 0xb1, 0x41, 0x44, 0x84, 0x44, 0xb8, 0x58, 0x8b, 0x4b, 148 | 0x12, 0x8b, 0x40, 0xa6, 0x30, 0x6a, 0x30, 0x07, 0x41, 0x38, 0x42, 0x12, 0x5c, 0x6c, 0x39, 0xa9, 149 | 0x79, 0xe9, 0x25, 0x19, 0x12, 0x4c, 0x20, 0x61, 0x0f, 0x86, 0x20, 0x28, 0xdf, 0x89, 0x87, 0x8b, 150 | 0x2b, 0x23, 0xb1, 0x38, 0x1e, 0xca, 0x33, 0xe2, 0x92, 0xc8, 0x2f, 0x4a, 0x47, 0xb6, 0x19, 0xee, 151 | 0x29, 0x27, 0x41, 0x74, 0x47, 0x14, 0x07, 0x30, 0xfe, 0x60, 0x64, 0x4c, 0x62, 0x03, 0x7b, 0xd0, 152 | 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xf8, 0xe6, 0xc9, 0xa7, 0x10, 0x01, 0x00, 0x00, 153 | } 154 | -------------------------------------------------------------------------------- /config/types.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. 2 | // source: tensorflow/core/framework/types.proto 3 | // DO NOT EDIT! 4 | 5 | package config 6 | 7 | import proto "github.com/golang/protobuf/proto" 8 | import fmt "fmt" 9 | import math "math" 10 | 11 | // Reference imports to suppress errors if they are not otherwise used. 12 | var _ = proto.Marshal 13 | var _ = fmt.Errorf 14 | var _ = math.Inf 15 | 16 | type DataType int32 17 | 18 | const ( 19 | // Not a legal value for DataType. Used to indicate a DataType field 20 | // has not been set. 21 | DataType_DT_INVALID DataType = 0 22 | // Data types that all computation devices are expected to be 23 | // capable to support. 24 | DataType_DT_FLOAT DataType = 1 25 | DataType_DT_DOUBLE DataType = 2 26 | DataType_DT_INT32 DataType = 3 27 | DataType_DT_UINT8 DataType = 4 28 | DataType_DT_INT16 DataType = 5 29 | DataType_DT_INT8 DataType = 6 30 | DataType_DT_STRING DataType = 7 31 | DataType_DT_COMPLEX64 DataType = 8 32 | DataType_DT_INT64 DataType = 9 33 | DataType_DT_BOOL DataType = 10 34 | DataType_DT_QINT8 DataType = 11 35 | DataType_DT_QUINT8 DataType = 12 36 | DataType_DT_QINT32 DataType = 13 37 | DataType_DT_BFLOAT16 DataType = 14 38 | DataType_DT_QINT16 DataType = 15 39 | DataType_DT_QUINT16 DataType = 16 40 | DataType_DT_UINT16 DataType = 17 41 | DataType_DT_COMPLEX128 DataType = 18 42 | DataType_DT_HALF DataType = 19 43 | // Do not use! These are only for parameters. Every enum above 44 | // should have a corresponding value below (verified by types_test). 45 | DataType_DT_FLOAT_REF DataType = 101 46 | DataType_DT_DOUBLE_REF DataType = 102 47 | DataType_DT_INT32_REF DataType = 103 48 | DataType_DT_UINT8_REF DataType = 104 49 | DataType_DT_INT16_REF DataType = 105 50 | DataType_DT_INT8_REF DataType = 106 51 | DataType_DT_STRING_REF DataType = 107 52 | DataType_DT_COMPLEX64_REF DataType = 108 53 | DataType_DT_INT64_REF DataType = 109 54 | DataType_DT_BOOL_REF DataType = 110 55 | DataType_DT_QINT8_REF DataType = 111 56 | DataType_DT_QUINT8_REF DataType = 112 57 | DataType_DT_QINT32_REF DataType = 113 58 | DataType_DT_BFLOAT16_REF DataType = 114 59 | DataType_DT_QINT16_REF DataType = 115 60 | DataType_DT_QUINT16_REF DataType = 116 61 | DataType_DT_UINT16_REF DataType = 117 62 | DataType_DT_COMPLEX128_REF DataType = 118 63 | DataType_DT_HALF_REF DataType = 119 64 | ) 65 | 66 | var DataType_name = map[int32]string{ 67 | 0: "DT_INVALID", 68 | 1: "DT_FLOAT", 69 | 2: "DT_DOUBLE", 70 | 3: "DT_INT32", 71 | 4: "DT_UINT8", 72 | 5: "DT_INT16", 73 | 6: "DT_INT8", 74 | 7: "DT_STRING", 75 | 8: "DT_COMPLEX64", 76 | 9: "DT_INT64", 77 | 10: "DT_BOOL", 78 | 11: "DT_QINT8", 79 | 12: "DT_QUINT8", 80 | 13: "DT_QINT32", 81 | 14: "DT_BFLOAT16", 82 | 15: "DT_QINT16", 83 | 16: "DT_QUINT16", 84 | 17: "DT_UINT16", 85 | 18: "DT_COMPLEX128", 86 | 19: "DT_HALF", 87 | 101: "DT_FLOAT_REF", 88 | 102: "DT_DOUBLE_REF", 89 | 103: "DT_INT32_REF", 90 | 104: "DT_UINT8_REF", 91 | 105: "DT_INT16_REF", 92 | 106: "DT_INT8_REF", 93 | 107: "DT_STRING_REF", 94 | 108: "DT_COMPLEX64_REF", 95 | 109: "DT_INT64_REF", 96 | 110: "DT_BOOL_REF", 97 | 111: "DT_QINT8_REF", 98 | 112: "DT_QUINT8_REF", 99 | 113: "DT_QINT32_REF", 100 | 114: "DT_BFLOAT16_REF", 101 | 115: "DT_QINT16_REF", 102 | 116: "DT_QUINT16_REF", 103 | 117: "DT_UINT16_REF", 104 | 118: "DT_COMPLEX128_REF", 105 | 119: "DT_HALF_REF", 106 | } 107 | var DataType_value = map[string]int32{ 108 | "DT_INVALID": 0, 109 | "DT_FLOAT": 1, 110 | "DT_DOUBLE": 2, 111 | "DT_INT32": 3, 112 | "DT_UINT8": 4, 113 | "DT_INT16": 5, 114 | "DT_INT8": 6, 115 | "DT_STRING": 7, 116 | "DT_COMPLEX64": 8, 117 | "DT_INT64": 9, 118 | "DT_BOOL": 10, 119 | "DT_QINT8": 11, 120 | "DT_QUINT8": 12, 121 | "DT_QINT32": 13, 122 | "DT_BFLOAT16": 14, 123 | "DT_QINT16": 15, 124 | "DT_QUINT16": 16, 125 | "DT_UINT16": 17, 126 | "DT_COMPLEX128": 18, 127 | "DT_HALF": 19, 128 | "DT_FLOAT_REF": 101, 129 | "DT_DOUBLE_REF": 102, 130 | "DT_INT32_REF": 103, 131 | "DT_UINT8_REF": 104, 132 | "DT_INT16_REF": 105, 133 | "DT_INT8_REF": 106, 134 | "DT_STRING_REF": 107, 135 | "DT_COMPLEX64_REF": 108, 136 | "DT_INT64_REF": 109, 137 | "DT_BOOL_REF": 110, 138 | "DT_QINT8_REF": 111, 139 | "DT_QUINT8_REF": 112, 140 | "DT_QINT32_REF": 113, 141 | "DT_BFLOAT16_REF": 114, 142 | "DT_QINT16_REF": 115, 143 | "DT_QUINT16_REF": 116, 144 | "DT_UINT16_REF": 117, 145 | "DT_COMPLEX128_REF": 118, 146 | "DT_HALF_REF": 119, 147 | } 148 | 149 | func (x DataType) String() string { 150 | return proto.EnumName(DataType_name, int32(x)) 151 | } 152 | func (DataType) EnumDescriptor() ([]byte, []int) { return fileDescriptor16, []int{0} } 153 | 154 | func init() { 155 | proto.RegisterEnum("tensorflow.DataType", DataType_name, DataType_value) 156 | } 157 | 158 | func init() { proto.RegisterFile("tensorflow/core/framework/types.proto", fileDescriptor16) } 159 | 160 | var fileDescriptor16 = []byte{ 161 | // 404 bytes of a gzipped FileDescriptorProto 162 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x54, 0x92, 0xdd, 0xae, 0xd2, 0x50, 163 | 0x10, 0x85, 0xad, 0x7a, 0xce, 0x81, 0x29, 0x3f, 0xc3, 0x46, 0x13, 0x5f, 0xc0, 0x1b, 0x63, 0x20, 164 | 0x05, 0xd2, 0x70, 0x4b, 0x2d, 0x68, 0x93, 0xda, 0x52, 0xdc, 0x18, 0xef, 0x1a, 0x34, 0x05, 0x95, 165 | 0x9f, 0x5d, 0xdb, 0x2a, 0xe1, 0x5d, 0x7c, 0x50, 0x2f, 0x4d, 0xa7, 0x03, 0xbb, 0xe7, 0x72, 0x7f, 166 | 0xb3, 0x66, 0x75, 0x75, 0x65, 0xe0, 0x75, 0x91, 0x9c, 0x72, 0x95, 0x6d, 0x0f, 0xea, 0x3c, 0xfc, 167 | 0xa6, 0xb2, 0x64, 0xb8, 0xcd, 0x36, 0xc7, 0xe4, 0xac, 0xb2, 0xfd, 0xb0, 0xb8, 0xa4, 0x49, 0x3e, 168 | 0x48, 0x33, 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, 0xec, 0x98, 0x50, 0x64, 0x22, 0xdf, 0xb5, 0xc6, 0xb2, 0x89, 0xfc, 0xe0, 0xe4, 0x37, 180 | 0xc9, 0x4f, 0x76, 0xae, 0x2a, 0x23, 0xb4, 0x17, 0x2f, 0x00, 0xeb, 0xb5, 0x11, 0x3d, 0x68, 0x2f, 181 | 0x26, 0xc7, 0x6b, 0x0b, 0x61, 0xe8, 0x13, 0x38, 0xb1, 0x24, 0xba, 0xb9, 0x2b, 0x76, 0x8f, 0x74, 182 | 0xa6, 0xf4, 0x8a, 0x74, 0xf0, 0x5f, 0xa2, 0x0f, 0xdd, 0x5a, 0x9d, 0x04, 0xb3, 0x9a, 0x8e, 0x51, 183 | 0x2e, 0x04, 0x74, 0x74, 0xad, 0xc4, 0x0a, 0x96, 0xd5, 0xd0, 0x6f, 0xf1, 0x12, 0x7a, 0x8f, 0xea, 184 | 0x25, 0xfc, 0x87, 0xe3, 0x96, 0x15, 0x13, 0x38, 0x3b, 0x6f, 0xe1, 0x95, 0xca, 0x76, 0x03, 0x7d, 185 | 0xb0, 0x83, 0xdb, 0x49, 0x3b, 0x66, 0x79, 0xb3, 0xf9, 0xb2, 0x3c, 0xe9, 0x7c, 0x69, 0xfc, 0x33, 186 | 0x8c, 0xaf, 0xf7, 0x74, 0xdf, 0xe3, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0x7e, 0xd4, 0x31, 0xb5, 187 | 0x08, 0x03, 0x00, 0x00, 188 | } 189 | -------------------------------------------------------------------------------- /config/variable.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. 2 | // source: tensorflow/core/framework/variable.proto 3 | // DO NOT EDIT! 4 | 5 | package config 6 | 7 | import proto "github.com/golang/protobuf/proto" 8 | import fmt "fmt" 9 | import math "math" 10 | 11 | // Reference imports to suppress errors if they are not otherwise used. 12 | var _ = proto.Marshal 13 | var _ = fmt.Errorf 14 | var _ = math.Inf 15 | 16 | // Protocol buffer representing a Variable. 17 | type VariableDef struct { 18 | // Name of the variable tensor. 19 | VariableName string `protobuf:"bytes,1,opt,name=variable_name,json=variableName" json:"variable_name,omitempty"` 20 | // Name of the initializer op. 21 | InitializerName string `protobuf:"bytes,2,opt,name=initializer_name,json=initializerName" json:"initializer_name,omitempty"` 22 | // Name of the snapshot tensor. 23 | SnapshotName string `protobuf:"bytes,3,opt,name=snapshot_name,json=snapshotName" json:"snapshot_name,omitempty"` 24 | // Support for saving variables as slices of a larger variable. 25 | SaveSliceInfoDef *SaveSliceInfoDef `protobuf:"bytes,4,opt,name=save_slice_info_def,json=saveSliceInfoDef" json:"save_slice_info_def,omitempty"` 26 | } 27 | 28 | func (m *VariableDef) Reset() { *m = VariableDef{} } 29 | func (m *VariableDef) String() string { return proto.CompactTextString(m) } 30 | func (*VariableDef) ProtoMessage() {} 31 | func (*VariableDef) Descriptor() ([]byte, []int) { return fileDescriptor17, []int{0} } 32 | 33 | func (m *VariableDef) GetSaveSliceInfoDef() *SaveSliceInfoDef { 34 | if m != nil { 35 | return m.SaveSliceInfoDef 36 | } 37 | return nil 38 | } 39 | 40 | type SaveSliceInfoDef struct { 41 | // Name of the full variable of which this is a slice. 42 | FullName string `protobuf:"bytes,1,opt,name=full_name,json=fullName" json:"full_name,omitempty"` 43 | // Shape of the full variable. 44 | FullShape []int32 `protobuf:"varint,2,rep,packed,name=full_shape,json=fullShape" json:"full_shape,omitempty"` 45 | // Offset of this variable into the full variable. 46 | VarOffset []int32 `protobuf:"varint,3,rep,packed,name=var_offset,json=varOffset" json:"var_offset,omitempty"` 47 | // Shape of this variable. 48 | VarShape []int32 `protobuf:"varint,4,rep,packed,name=var_shape,json=varShape" json:"var_shape,omitempty"` 49 | } 50 | 51 | func (m *SaveSliceInfoDef) Reset() { *m = SaveSliceInfoDef{} } 52 | func (m *SaveSliceInfoDef) String() string { return proto.CompactTextString(m) } 53 | func (*SaveSliceInfoDef) ProtoMessage() {} 54 | func (*SaveSliceInfoDef) Descriptor() ([]byte, []int) { return fileDescriptor17, []int{1} } 55 | 56 | func init() { 57 | proto.RegisterType((*VariableDef)(nil), "tensorflow.VariableDef") 58 | proto.RegisterType((*SaveSliceInfoDef)(nil), "tensorflow.SaveSliceInfoDef") 59 | } 60 | 61 | func init() { proto.RegisterFile("tensorflow/core/framework/variable.proto", fileDescriptor17) } 62 | 63 | var fileDescriptor17 = []byte{ 64 | // 297 bytes of a gzipped FileDescriptorProto 65 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x5c, 0x91, 0xc1, 0x4a, 0xf3, 0x40, 66 | 0x10, 0xc7, 0xd9, 0xaf, 0xfd, 0xa4, 0x9d, 0x5a, 0x2d, 0xf1, 0x12, 0x50, 0xa1, 0xb4, 0x97, 0x78, 67 | 0x69, 0x40, 0xdf, 0xa0, 0xf4, 0x22, 0x82, 0x96, 0x04, 0xbc, 0x86, 0x69, 0x9d, 0xb5, 0x8b, 0x9b, 68 | 0xdd, 0xb0, 0x1b, 0xb7, 0xe0, 0x23, 0xf8, 0x72, 0xbe, 0x8e, 0x47, 0xd9, 0x8d, 0xb1, 0xa1, 0xd7, 69 | 0xdf, 0xff, 0x37, 0x93, 0xcc, 0xfe, 0x21, 0xa9, 0x49, 0x59, 0x6d, 0xb8, 0xd4, 0xfb, 0x74, 0xab, 70 | 0x0d, 0xa5, 0xdc, 0x60, 0x49, 0x7b, 0x6d, 0xde, 0x52, 0x87, 0x46, 0xe0, 0x46, 0xd2, 0xa2, 0x32, 71 | 0xba, 0xd6, 0x11, 0x1c, 0xcc, 0xd9, 0x17, 0x83, 0xd1, 0xf3, 0x6f, 0xbc, 0x22, 0x1e, 0xcd, 0x61, 72 | 0xdc, 0xda, 0x85, 0xc2, 0x92, 0x62, 0x36, 0x65, 0xc9, 0x30, 0x3b, 0x6d, 0xe1, 0x23, 0x96, 0x14, 73 | 0xdd, 0xc0, 0x44, 0x28, 0x51, 0x0b, 0x94, 0xe2, 0x83, 0x4c, 0xe3, 0xfd, 0x0b, 0xde, 0x79, 0x87, 74 | 0x07, 0x75, 0x0e, 0x63, 0xab, 0xb0, 0xb2, 0x3b, 0x5d, 0x37, 0x5e, 0xaf, 0xd9, 0xd7, 0xc2, 0x20, 75 | 0x3d, 0xc0, 0x85, 0x45, 0x47, 0x85, 0x95, 0x62, 0x4b, 0x85, 0x50, 0x5c, 0x17, 0x2f, 0xc4, 0xe3, 76 | 0xfe, 0x94, 0x25, 0xa3, 0xdb, 0xab, 0xc5, 0xe1, 0x77, 0x17, 0x39, 0x3a, 0xca, 0xbd, 0x75, 0xaf, 77 | 0xb8, 0x5e, 0x11, 0xcf, 0x26, 0xf6, 0x88, 0xcc, 0x3e, 0x19, 0x4c, 0x8e, 0xb5, 0xe8, 0x12, 0x86, 78 | 0xfc, 0x5d, 0xca, 0xee, 0x49, 0x03, 0x0f, 0xc2, 0xe7, 0xaf, 0x01, 0x42, 0x68, 0x77, 0x58, 0xf9, 79 | 0x43, 0x7a, 0xc9, 0xff, 0x2c, 0xe8, 0xb9, 0x07, 0x3e, 0x76, 0x68, 0x0a, 0xcd, 0xb9, 0xa5, 0x3a, 80 | 0xee, 0x35, 0xb1, 0x43, 0xf3, 0x14, 0x80, 0x5f, 0xed, 0xe3, 0x66, 0xb8, 0x1f, 0xd2, 0x81, 0x43, 81 | 0x13, 0x66, 0x97, 0x29, 0xc4, 0xda, 0xbc, 0x76, 0x2f, 0xf8, 0x6b, 0x65, 0x79, 0xd6, 0xbe, 0xfb, 82 | 0xda, 0xb7, 0x62, 0xd7, 0xec, 0x9b, 0xb1, 0xcd, 0x49, 0xa8, 0xe8, 0xee, 0x27, 0x00, 0x00, 0xff, 83 | 0xff, 0x6b, 0x57, 0x9f, 0xbb, 0xce, 0x01, 0x00, 0x00, 84 | } 85 | -------------------------------------------------------------------------------- /config/versions.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. 2 | // source: tensorflow/core/framework/versions.proto 3 | // DO NOT EDIT! 4 | 5 | package config 6 | 7 | import proto "github.com/golang/protobuf/proto" 8 | import fmt "fmt" 9 | import math "math" 10 | 11 | // Reference imports to suppress errors if they are not otherwise used. 12 | var _ = proto.Marshal 13 | var _ = fmt.Errorf 14 | var _ = math.Inf 15 | 16 | // Version information for a piece of serialized data 17 | // 18 | // There are different types of versions for each type of data 19 | // (GraphDef, etc.), but they all have the same common shape 20 | // described here. 21 | // 22 | // Each consumer has "consumer" and "min_producer" versions (specified 23 | // elsewhere). A consumer is allowed to consume this data if 24 | // 25 | // producer >= min_producer 26 | // consumer >= min_consumer 27 | // consumer not in bad_consumers 28 | // 29 | type VersionDef struct { 30 | // The version of the code that produced this data. 31 | Producer int32 `protobuf:"varint,1,opt,name=producer" json:"producer,omitempty"` 32 | // Any consumer below this version is not allowed to consume this data. 33 | MinConsumer int32 `protobuf:"varint,2,opt,name=min_consumer,json=minConsumer" json:"min_consumer,omitempty"` 34 | // Specific consumer versions which are disallowed (e.g. due to bugs). 35 | BadConsumers []int32 `protobuf:"varint,3,rep,packed,name=bad_consumers,json=badConsumers" json:"bad_consumers,omitempty"` 36 | } 37 | 38 | func (m *VersionDef) Reset() { *m = VersionDef{} } 39 | func (m *VersionDef) String() string { return proto.CompactTextString(m) } 40 | func (*VersionDef) ProtoMessage() {} 41 | func (*VersionDef) Descriptor() ([]byte, []int) { return fileDescriptor18, []int{0} } 42 | 43 | func init() { 44 | proto.RegisterType((*VersionDef)(nil), "tensorflow.VersionDef") 45 | } 46 | 47 | func init() { proto.RegisterFile("tensorflow/core/framework/versions.proto", fileDescriptor18) } 48 | 49 | var fileDescriptor18 = []byte{ 50 | // 183 bytes of a gzipped FileDescriptorProto 51 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x44, 0xce, 0xbf, 0x8e, 0x82, 0x40, 52 | 0x10, 0xc7, 0xf1, 0xec, 0x11, 0x2e, 0x97, 0x39, 0xb4, 0xd8, 0x6a, 0x63, 0x85, 0xda, 0x50, 0xb1, 53 | 0x85, 0x6f, 0x80, 0x3e, 0x00, 0xa1, 0xb0, 0x35, 0xfc, 0x59, 0x0c, 0xd1, 0xdd, 0x21, 0x33, 0x20, 54 | 0xaf, 0x6e, 0x69, 0x44, 0x84, 0x72, 0xe6, 0xf7, 0x2d, 0x3e, 0x10, 0x75, 0xc6, 0x31, 0x52, 0x7d, 55 | 0xc7, 0x41, 0x97, 0x48, 0x46, 0xd7, 0x94, 0x5b, 0x33, 0x20, 0xdd, 0xf4, 0xc3, 0x10, 0x37, 0xe8, 56 | 0x38, 0x6e, 0x09, 0x3b, 0x94, 0xb0, 0x94, 0xbb, 0x16, 0xe0, 0xfc, 0x59, 0x4f, 0xa6, 0x96, 0x1b, 57 | 0xf8, 0x6b, 0x09, 0xab, 0xbe, 0x34, 0xa4, 0x44, 0x28, 0x22, 0x3f, 0x9b, 0x6f, 0xb9, 0x85, 0xc0, 58 | 0x36, 0xee, 0x52, 0xa2, 0xe3, 0xde, 0x1a, 0x52, 0x3f, 0xe3, 0xfe, 0x6f, 0x1b, 0x77, 0x9c, 0x5e, 59 | 0x72, 0x0f, 0xab, 0x22, 0xaf, 0xe6, 0x84, 0x95, 0x17, 0x7a, 0x91, 0x9f, 0x05, 0x45, 0x5e, 0x7d, 60 | 0x1b, 0x4e, 0x34, 0x28, 0xa4, 0x6b, 0xbc, 0x18, 0xe2, 0x19, 0x9a, 0xac, 0x27, 0x0b, 0xa7, 0x6f, 61 | 0x28, 0xa7, 0xe2, 0x29, 0x44, 0xf1, 0x3b, 0xaa, 0x0f, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa2, 62 | 0xca, 0xc7, 0x87, 0xe1, 0x00, 0x00, 0x00, 63 | } 64 | -------------------------------------------------------------------------------- /generate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # int32 tensors 4 | genny -in=generic_tensor.go -out=tensor_int32.go gen "ValueType=int32 ValueCType=C.TF_INT32" 5 | sed -i -e 's/TF_FLOAT/TF_INT32/g' -e '/tensorflow.h/a import "C"' tensor_int32.go 6 | 7 | # float32 tensors 8 | genny -in=generic_tensor.go -out=tensor_float32.go gen "ValueType=float32" 9 | sed -i '/tensorflow.h/a import "C"' tensor_float32.go 10 | -------------------------------------------------------------------------------- /generic_tensor.go: -------------------------------------------------------------------------------- 1 | package tensorflow 2 | 3 | //go:generate genny -in=$GOFILE -out=tensor_int32.go gen "ValueType=int32 ValueCType=C.TF_INT32" 4 | 5 | // #include 6 | // #include "tensorflow.h" 7 | import "C" 8 | 9 | import ( 10 | "fmt" 11 | "unsafe" 12 | 13 | "github.com/cheekybits/genny/generic" 14 | ) 15 | 16 | type ValueType generic.Type 17 | 18 | var _ Tensor = &ValueTypeTensor{} 19 | 20 | type ValueTypeTensor struct { 21 | dims []int 22 | data []ValueType 23 | } 24 | 25 | func NewValueTypeTensor(dims []int) *ValueTypeTensor { 26 | size := 1 27 | for _, dim := range dims { 28 | size *= dim 29 | } 30 | 31 | return &ValueTypeTensor{ 32 | dims: dims, 33 | data: make([]ValueType, size), 34 | } 35 | } 36 | 37 | func (t *ValueTypeTensor) index(idx []int) (int, int) { 38 | if len(idx) >= len(t.dims) { 39 | panic(fmt.Sprintf("Trying to address using %d dimensions, only %d permitted", 40 | len(idx), len(t.dims)-1)) 41 | } 42 | 43 | // Special case: the full array 44 | if len(idx) == 0 { 45 | dimSize := 1 46 | for _, dim := range t.dims { 47 | dimSize *= dim 48 | } 49 | 50 | return 0, dimSize 51 | } 52 | 53 | startIdx := 0 54 | var dimSize int 55 | for i, idx := range idx { 56 | dimSize = 1 57 | for _, dim := range t.dims[i+1:] { 58 | dimSize *= dim 59 | } 60 | 61 | startIdx += idx * dimSize 62 | } 63 | 64 | return startIdx, dimSize 65 | } 66 | 67 | func (t *ValueTypeTensor) Get(idx []int) []ValueType { 68 | startIdx, dimSize := t.index(idx) 69 | 70 | return t.data[startIdx : startIdx+dimSize] 71 | } 72 | 73 | func (t *ValueTypeTensor) Assign(idx []int, data []ValueType) { 74 | startIdx, _ := t.index(idx) 75 | 76 | if len(idx) >= len(t.dims) { 77 | panic(fmt.Sprintf("Trying to address using %d dimensions, only %d permitted", 78 | len(idx), len(t.dims)-1)) 79 | } 80 | 81 | // TODO: bounds checks? 82 | 83 | copy(t.data[startIdx:], data) 84 | } 85 | 86 | func (t *ValueTypeTensor) Fill(idx []int, v ValueType) { 87 | startIdx, dimSize := t.index(idx) 88 | 89 | for idx := startIdx; idx < startIdx+dimSize; idx++ { 90 | t.data[idx] = v 91 | } 92 | } 93 | 94 | func (t *ValueTypeTensor) ToNative() *NativeTensor { 95 | // TF_NewTensor copies dims, does not take ownership. 96 | llDims := make([]C.longlong, len(t.dims)) 97 | for idx, val := range t.dims { 98 | llDims[idx] = C.longlong(val) 99 | } 100 | 101 | dataLen := C.size_t(len(t.data)) * C.size_t(unsafe.Sizeof(t.data[0])) 102 | 103 | // Allocate new memory, rather than using the Go slice backing array, 104 | // since we cannot fullfil the alignment preferences. 105 | cTensor := C.TF_AllocateTensor(C.TF_FLOAT, (*C.int64_t)(unsafe.Pointer(&llDims[0])), 106 | C.int(len(llDims)), dataLen) 107 | cData := C.TF_TensorData(cTensor) 108 | 109 | C.memcpy(cData, unsafe.Pointer(&t.data[0]), dataLen) 110 | 111 | return &NativeTensor{ 112 | inner: cTensor, 113 | } 114 | } 115 | 116 | func adoptValueTypeTensor(ct *C.TF_Tensor) *ValueTypeTensor { 117 | dims := C.TF_NumDims(ct) 118 | shape := make([]int, dims) 119 | size := uint(1) 120 | for i := C.int(0); i < dims; i++ { 121 | shape[i] = int(C.TF_Dim(ct, i)) 122 | size *= uint(shape[i]) 123 | } 124 | 125 | bs := C.TF_TensorByteSize(ct) 126 | var valForSize ValueType 127 | if uint(bs)/uint(unsafe.Sizeof(valForSize)) != size { 128 | panic("Expected tensor size does not correspond to the actual tensor size") 129 | } 130 | 131 | data := make([]ValueType, size) 132 | C.memcpy(unsafe.Pointer(&data[0]), C.TF_TensorData(ct), bs) 133 | 134 | return &ValueTypeTensor{ 135 | dims: shape, 136 | data: data, 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /graph.go: -------------------------------------------------------------------------------- 1 | package tensorflow 2 | 3 | // #include "tensorflow.h" 4 | import "C" 5 | 6 | // Graph is a Tensorflow computation graph. 7 | type Graph struct { 8 | graph *C.TF_Graph 9 | } 10 | 11 | // NewGraph allocates a graph. 12 | func NewGraph() *Graph { 13 | return &Graph{ 14 | graph: C.TF_NewGraph(), 15 | } 16 | } 17 | 18 | // Close deallocates a graph. Tensorflow automatically deallocates a graph 19 | // when all sessions referencing the graph are closed. 20 | func (g *Graph) Close() { 21 | C.TF_DeleteGraph(g.graph) 22 | g.graph = nil 23 | } 24 | -------------------------------------------------------------------------------- /tensor.go: -------------------------------------------------------------------------------- 1 | package tensorflow 2 | 3 | // #include 4 | // #include "tensorflow.h" 5 | import "C" 6 | 7 | import "fmt" 8 | 9 | type Tensor interface { 10 | ToNative() *NativeTensor 11 | } 12 | 13 | type NativeTensor struct { 14 | inner *C.TF_Tensor 15 | } 16 | 17 | func (nt *NativeTensor) Close() { 18 | C.TF_DeleteTensor(nt.inner) 19 | } 20 | 21 | func (nt *NativeTensor) ToGo() Tensor { 22 | return adoptTensor(nt.inner) 23 | } 24 | 25 | var _ Tensor = &Float32Tensor{} 26 | 27 | func adoptTensor(ct *C.TF_Tensor) Tensor { 28 | defer C.TF_DeleteTensor(ct) 29 | 30 | ttype := C.TF_TensorType(ct) 31 | switch ttype { 32 | case C.TF_INT32: 33 | return adoptint32Tensor(ct) 34 | case C.TF_FLOAT: 35 | return adoptfloat32Tensor(ct) 36 | default: 37 | panic(fmt.Sprintf("Support for adopting tensor type %d is not implemented", ttype)) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tensor_float32.go: -------------------------------------------------------------------------------- 1 | // This file was automatically generated by genny. 2 | // Any changes will be lost if this file is regenerated. 3 | // see https://github.com/cheekybits/genny 4 | 5 | package tensorflow 6 | 7 | import ( 8 | "C" 9 | "fmt" 10 | "unsafe" 11 | ) 12 | 13 | // #include 14 | // #include "tensorflow.h" 15 | import "C" 16 | 17 | var _ Tensor = &Float32Tensor{} 18 | 19 | type Float32Tensor struct { 20 | dims []int 21 | data []float32 22 | } 23 | 24 | func NewFloat32Tensor(dims []int) *Float32Tensor { 25 | size := 1 26 | for _, dim := range dims { 27 | size *= dim 28 | } 29 | 30 | return &Float32Tensor{ 31 | dims: dims, 32 | data: make([]float32, size), 33 | } 34 | } 35 | 36 | func (t *Float32Tensor) index(idx []int) (int, int) { 37 | if len(idx) >= len(t.dims) { 38 | panic(fmt.Sprintf("Trying to address using %d dimensions, only %d permitted", 39 | len(idx), len(t.dims)-1)) 40 | } 41 | 42 | // Special case: the full array 43 | if len(idx) == 0 { 44 | dimSize := 1 45 | for _, dim := range t.dims { 46 | dimSize *= dim 47 | } 48 | 49 | return 0, dimSize 50 | } 51 | 52 | startIdx := 0 53 | var dimSize int 54 | for i, idx := range idx { 55 | dimSize = 1 56 | for _, dim := range t.dims[i+1:] { 57 | dimSize *= dim 58 | } 59 | 60 | startIdx += idx * dimSize 61 | } 62 | 63 | return startIdx, dimSize 64 | } 65 | 66 | func (t *Float32Tensor) Get(idx []int) []float32 { 67 | startIdx, dimSize := t.index(idx) 68 | 69 | return t.data[startIdx : startIdx+dimSize] 70 | } 71 | 72 | func (t *Float32Tensor) Assign(idx []int, data []float32) { 73 | startIdx, _ := t.index(idx) 74 | 75 | if len(idx) >= len(t.dims) { 76 | panic(fmt.Sprintf("Trying to address using %d dimensions, only %d permitted", 77 | len(idx), len(t.dims)-1)) 78 | } 79 | 80 | // TODO: bounds checks? 81 | 82 | copy(t.data[startIdx:], data) 83 | } 84 | 85 | func (t *Float32Tensor) Fill(idx []int, v float32) { 86 | startIdx, dimSize := t.index(idx) 87 | 88 | for idx := startIdx; idx < startIdx+dimSize; idx++ { 89 | t.data[idx] = v 90 | } 91 | } 92 | 93 | func (t *Float32Tensor) ToNative() *NativeTensor { 94 | // TF_NewTensor copies dims, does not take ownership. 95 | llDims := make([]C.longlong, len(t.dims)) 96 | for idx, val := range t.dims { 97 | llDims[idx] = C.longlong(val) 98 | } 99 | 100 | dataLen := C.size_t(len(t.data)) * C.size_t(unsafe.Sizeof(t.data[0])) 101 | 102 | // Allocate new memory, rather than using the Go slice backing array, 103 | // since we cannot fullfil the alignment preferences. 104 | cTensor := C.TF_AllocateTensor(C.TF_FLOAT, (*C.int64_t)(unsafe.Pointer(&llDims[0])), 105 | C.int(len(llDims)), dataLen) 106 | cData := C.TF_TensorData(cTensor) 107 | 108 | C.memcpy(cData, unsafe.Pointer(&t.data[0]), dataLen) 109 | 110 | return &NativeTensor{ 111 | inner: cTensor, 112 | } 113 | } 114 | 115 | func adoptfloat32Tensor(ct *C.TF_Tensor) *Float32Tensor { 116 | dims := C.TF_NumDims(ct) 117 | shape := make([]int, dims) 118 | size := uint(1) 119 | for i := C.int(0); i < dims; i++ { 120 | shape[i] = int(C.TF_Dim(ct, i)) 121 | size *= uint(shape[i]) 122 | } 123 | 124 | bs := C.TF_TensorByteSize(ct) 125 | var valForSize float32 126 | if uint(bs)/uint(unsafe.Sizeof(valForSize)) != size { 127 | panic("Expected tensor size does not correspond to the actual tensor size") 128 | } 129 | 130 | data := make([]float32, size) 131 | C.memcpy(unsafe.Pointer(&data[0]), C.TF_TensorData(ct), bs) 132 | 133 | return &Float32Tensor{ 134 | dims: shape, 135 | data: data, 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /tensor_int32.go: -------------------------------------------------------------------------------- 1 | // This file was automatically generated by genny. 2 | // Any changes will be lost if this file is regenerated. 3 | // see https://github.com/cheekybits/genny 4 | 5 | package tensorflow 6 | 7 | import ( 8 | "C" 9 | "fmt" 10 | "unsafe" 11 | ) 12 | 13 | // #include 14 | // #include "tensorflow.h" 15 | import "C" 16 | 17 | var _ Tensor = &Int32Tensor{} 18 | 19 | type Int32Tensor struct { 20 | dims []int 21 | data []int32 22 | } 23 | 24 | func NewInt32Tensor(dims []int) *Int32Tensor { 25 | size := 1 26 | for _, dim := range dims { 27 | size *= dim 28 | } 29 | 30 | return &Int32Tensor{ 31 | dims: dims, 32 | data: make([]int32, size), 33 | } 34 | } 35 | 36 | func (t *Int32Tensor) index(idx []int) (int, int) { 37 | if len(idx) >= len(t.dims) { 38 | panic(fmt.Sprintf("Trying to address using %d dimensions, only %d permitted", 39 | len(idx), len(t.dims)-1)) 40 | } 41 | 42 | // Special case: the full array 43 | if len(idx) == 0 { 44 | dimSize := 1 45 | for _, dim := range t.dims { 46 | dimSize *= dim 47 | } 48 | 49 | return 0, dimSize 50 | } 51 | 52 | startIdx := 0 53 | var dimSize int 54 | for i, idx := range idx { 55 | dimSize = 1 56 | for _, dim := range t.dims[i+1:] { 57 | dimSize *= dim 58 | } 59 | 60 | startIdx += idx * dimSize 61 | } 62 | 63 | return startIdx, dimSize 64 | } 65 | 66 | func (t *Int32Tensor) Get(idx []int) []int32 { 67 | startIdx, dimSize := t.index(idx) 68 | 69 | return t.data[startIdx : startIdx+dimSize] 70 | } 71 | 72 | func (t *Int32Tensor) Assign(idx []int, data []int32) { 73 | startIdx, _ := t.index(idx) 74 | 75 | if len(idx) >= len(t.dims) { 76 | panic(fmt.Sprintf("Trying to address using %d dimensions, only %d permitted", 77 | len(idx), len(t.dims)-1)) 78 | } 79 | 80 | // TODO: bounds checks? 81 | 82 | copy(t.data[startIdx:], data) 83 | } 84 | 85 | func (t *Int32Tensor) Fill(idx []int, v int32) { 86 | startIdx, dimSize := t.index(idx) 87 | 88 | for idx := startIdx; idx < startIdx+dimSize; idx++ { 89 | t.data[idx] = v 90 | } 91 | } 92 | 93 | func (t *Int32Tensor) ToNative() *NativeTensor { 94 | // TF_NewTensor copies dims, does not take ownership. 95 | llDims := make([]C.longlong, len(t.dims)) 96 | for idx, val := range t.dims { 97 | llDims[idx] = C.longlong(val) 98 | } 99 | 100 | dataLen := C.size_t(len(t.data)) * C.size_t(unsafe.Sizeof(t.data[0])) 101 | 102 | // Allocate new memory, rather than using the Go slice backing array, 103 | // since we cannot fullfil the alignment preferences. 104 | cTensor := C.TF_AllocateTensor(C.TF_INT32, (*C.int64_t)(unsafe.Pointer(&llDims[0])), 105 | C.int(len(llDims)), dataLen) 106 | cData := C.TF_TensorData(cTensor) 107 | 108 | C.memcpy(cData, unsafe.Pointer(&t.data[0]), dataLen) 109 | 110 | return &NativeTensor{ 111 | inner: cTensor, 112 | } 113 | } 114 | 115 | func adoptint32Tensor(ct *C.TF_Tensor) *Int32Tensor { 116 | dims := C.TF_NumDims(ct) 117 | shape := make([]int, dims) 118 | size := uint(1) 119 | for i := C.int(0); i < dims; i++ { 120 | shape[i] = int(C.TF_Dim(ct, i)) 121 | size *= uint(shape[i]) 122 | } 123 | 124 | bs := C.TF_TensorByteSize(ct) 125 | var valForSize int32 126 | if uint(bs)/uint(unsafe.Sizeof(valForSize)) != size { 127 | panic("Expected tensor size does not correspond to the actual tensor size") 128 | } 129 | 130 | data := make([]int32, size) 131 | C.memcpy(unsafe.Pointer(&data[0]), C.TF_TensorData(ct), bs) 132 | 133 | return &Int32Tensor{ 134 | dims: shape, 135 | data: data, 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /tensorflow.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "tensorflow.h" 4 | 5 | TF_Tensor *tfgo_tensor(TF_DataType type, int64_t const *dims, int num_dims, 6 | void *data, size_t len) 7 | { 8 | return TF_NewTensor(type, dims, num_dims, data, len, tfgo_dealloc, 0); 9 | } 10 | 11 | void tfgo_dealloc(void *data, size_t len, void *arg) 12 | { 13 | free(data); 14 | } 15 | -------------------------------------------------------------------------------- /tensorflow.go: -------------------------------------------------------------------------------- 1 | package tensorflow 2 | 3 | // #cgo LDFLAGS: -ltensorflow 4 | // #include 5 | // #include 6 | // #include "tensorflow.h" 7 | import "C" 8 | import ( 9 | "errors" 10 | "unsafe" 11 | 12 | tfconfig "github.com/danieldk/tensorflow/config" 13 | "github.com/golang/protobuf/proto" 14 | ) 15 | 16 | type SessionOptions struct { 17 | options *C.TF_SessionOptions 18 | } 19 | 20 | func NewSessionOptions() *SessionOptions { 21 | opts := &SessionOptions{ 22 | options: C.TF_NewSessionOptions(), 23 | } 24 | 25 | return opts 26 | } 27 | 28 | func (opts *SessionOptions) Close() { 29 | C.TF_DeleteSessionOptions(opts.options) 30 | } 31 | 32 | func (opts *SessionOptions) SetConfig(config tfconfig.ConfigProto) error { 33 | status := C.TF_NewStatus() 34 | defer C.TF_DeleteStatus(status) 35 | 36 | data, err := proto.Marshal(&config) 37 | if err != nil { 38 | return err 39 | } 40 | 41 | C.TF_SetConfig(opts.options, unsafe.Pointer(&data[0]), C.size_t(len(data)), status) 42 | 43 | if C.TF_GetCode(status) == 0 { 44 | return nil 45 | } 46 | 47 | return errors.New(C.GoString(C.TF_Message(status))) 48 | } 49 | 50 | type Session struct { 51 | session *C.TF_DeprecatedSession 52 | } 53 | 54 | func NewSession(graph *Graph, opts *SessionOptions) (*Session, error) { 55 | status := C.TF_NewStatus() 56 | defer C.TF_DeleteStatus(status) 57 | 58 | session := &Session{ 59 | session: C.TF_NewDeprecatedSession(opts.options, status), 60 | } 61 | 62 | if C.TF_GetCode(status) != 0 { 63 | return nil, errors.New(C.GoString(C.TF_Message(status))) 64 | } 65 | 66 | return session, nil 67 | } 68 | 69 | func (s *Session) Close() error { 70 | status := C.TF_NewStatus() 71 | defer C.TF_DeleteStatus(status) 72 | 73 | C.TF_CloseDeprecatedSession(s.session, status) 74 | if C.TF_GetCode(status) != 0 { 75 | return errors.New(C.GoString(C.TF_Message(status))) 76 | } 77 | 78 | C.TF_DeleteDeprecatedSession(s.session, status) 79 | if C.TF_GetCode(status) != 0 { 80 | return errors.New(C.GoString(C.TF_Message(status))) 81 | } 82 | 83 | s.session = nil 84 | 85 | return nil 86 | } 87 | 88 | func (s *Session) ExtendGraph(data []byte) error { 89 | status := C.TF_NewStatus() 90 | defer C.TF_DeleteStatus(status) 91 | 92 | C.TF_ExtendGraph(s.session, unsafe.Pointer(&data[0]), C.size_t(len(data)), status) 93 | 94 | if C.TF_GetCode(status) != 0 { 95 | return errors.New(C.GoString(C.TF_Message(status))) 96 | } 97 | 98 | return nil 99 | } 100 | 101 | func (s *Session) Run(inputs map[string]*NativeTensor, outputs []string) (map[string]Tensor, error) { 102 | inputNames := make([]*C.char, len(inputs)) 103 | inputTensors := make([]*C.TF_Tensor, len(inputs)) 104 | idx := 0 105 | for input, tensor := range inputs { 106 | cStr := C.CString(input) 107 | defer C.free(unsafe.Pointer(cStr)) 108 | inputNames[idx] = cStr 109 | inputTensors[idx] = tensor.inner 110 | idx++ 111 | } 112 | 113 | outputNames := make([]*C.char, len(outputs)) 114 | outputTensors := make([]*C.TF_Tensor, len(outputs)) 115 | for idx, output := range outputs { 116 | cStr := C.CString(output) 117 | defer C.free(unsafe.Pointer(cStr)) 118 | outputNames[idx] = cStr 119 | } 120 | 121 | status := C.TF_NewStatus() 122 | defer C.TF_DeleteStatus(status) 123 | 124 | C.TF_Run(s.session, nil, &inputNames[0], &inputTensors[0], C.int(len(inputNames)), 125 | &outputNames[0], &outputTensors[0], C.int(len(outputNames)), 126 | nil, 0, nil, status) 127 | 128 | if C.TF_GetCode(status) != 0 { 129 | return nil, errors.New(C.GoString(C.TF_Message(status))) 130 | } 131 | 132 | outputMap := make(map[string]Tensor) 133 | for idx, name := range outputs { 134 | outputMap[name] = adoptTensor(outputTensors[idx]) 135 | } 136 | 137 | return outputMap, nil 138 | } 139 | -------------------------------------------------------------------------------- /tensorflow.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | TF_Tensor *tfgo_tensor(TF_DataType type, int64_t const *dims, int num_dims, 6 | void *data, size_t len); 7 | void tfgo_dealloc(void *data, size_t len, void *arg); 8 | -------------------------------------------------------------------------------- /tensorflow_test.go: -------------------------------------------------------------------------------- 1 | package tensorflow 2 | 3 | import "testing" 4 | 5 | func TestSession(t *testing.T) { 6 | opts := NewSessionOptions() 7 | defer opts.Close() 8 | 9 | graph := NewGraph() 10 | defer graph.Close() 11 | 12 | sess, err := NewSession(graph, opts) 13 | if err != nil { 14 | t.Error(err) 15 | } 16 | defer sess.Close() 17 | } 18 | --------------------------------------------------------------------------------