Skip to content

Commit

Permalink
Give unique go package paths in core/framework to avoid circular depe…
Browse files Browse the repository at this point in the history
…ndencies.

PiperOrigin-RevId: 293433590
Change-Id: Ia0dd6ed36cadcf2372805f6a83d5cfb51618db8c
  • Loading branch information
Jonathan Hseu authored and tensorflower-gardener committed Feb 5, 2020
1 parent c6f7b48 commit 4221d1a
Show file tree
Hide file tree
Showing 60 changed files with 248 additions and 208 deletions.
10 changes: 6 additions & 4 deletions tensorflow/core/example/example.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
// model training or inference.
syntax = "proto3";

package tensorflow;

import "tensorflow/core/example/feature.proto";

option cc_enable_arenas = true;
option java_outer_classname = "ExampleProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.example";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/example";
package tensorflow;
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/example/example_protos_go_proto";

// An Example is a mostly-normalized data format for storing data for
// training and inference. It contains a key-value store (features); where
Expand Down Expand Up @@ -87,7 +89,7 @@ package tensorflow;

message Example {
Features features = 1;
};
}

// A SequenceExample is an Example representing one or more sequences, and
// some context. The context contains features which apply to the entire
Expand Down Expand Up @@ -298,4 +300,4 @@ message Example {
message SequenceExample {
Features context = 1;
FeatureLists feature_lists = 2;
};
}
21 changes: 11 additions & 10 deletions tensorflow/core/example/example_parser_configuration.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,39 @@

syntax = "proto3";

option cc_enable_arenas = true;
option java_outer_classname = "ExampleParserConfigurationProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.example";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/example";
package tensorflow;

import "tensorflow/core/framework/tensor_shape.proto";
import "tensorflow/core/framework/tensor.proto";
import "tensorflow/core/framework/tensor_shape.proto";
import "tensorflow/core/framework/types.proto";

option cc_enable_arenas = true;
option java_outer_classname = "ExampleParserConfigurationProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.example";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/example/example_parser_configuration_go_proto";

message VarLenFeatureProto {
tensorflow.DataType dtype = 1;
string values_output_tensor_name = 2;
string indices_output_tensor_name = 3;
string shapes_output_tensor_name = 4;
};
}

message FixedLenFeatureProto {
tensorflow.DataType dtype = 1;
tensorflow.TensorShapeProto shape = 2;
tensorflow.TensorProto default_value = 3;
string values_output_tensor_name = 4;
};
}

message FeatureConfiguration {
oneof config {
FixedLenFeatureProto fixed_len_feature = 1;
VarLenFeatureProto var_len_feature = 2;
}
};
}

message ExampleParserConfiguration {
map<string, FeatureConfiguration> feature_map = 1;
};
}
14 changes: 8 additions & 6 deletions tensorflow/core/example/feature.proto
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,14 @@
//

syntax = "proto3";

package tensorflow;

option cc_enable_arenas = true;
option java_outer_classname = "FeatureProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.example";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/example";
package tensorflow;
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/example/example_protos_go_proto";

// Containers to hold repeated fundamental values.
message BytesList {
Expand All @@ -80,12 +82,12 @@ message Feature {
FloatList float_list = 2;
Int64List int64_list = 3;
}
};
}

message Features {
// Map from feature name to feature.
map<string, Feature> feature = 1;
};
}

// Containers for sequential data.
//
Expand All @@ -97,9 +99,9 @@ message Features {
//
message FeatureList {
repeated Feature feature = 1;
};
}

message FeatureLists {
// Map from feature name to feature list.
map<string, FeatureList> feature_list = 1;
};
}
5 changes: 3 additions & 2 deletions tensorflow/core/framework/allocation_description.proto
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
syntax = "proto3";

package tensorflow;

option cc_enable_arenas = true;
option java_outer_classname = "AllocationDescriptionProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/allocation_description_go_proto";

message AllocationDescription {
// Total number of bytes requested
Expand All @@ -25,4 +26,4 @@ message AllocationDescription {

// Address of the allocation.
uint64 ptr = 6;
};
}
10 changes: 6 additions & 4 deletions tensorflow/core/framework/attr_value.proto
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
syntax = "proto3";

package tensorflow;

import "tensorflow/core/framework/tensor.proto";
import "tensorflow/core/framework/tensor_shape.proto";
import "tensorflow/core/framework/types.proto";

option cc_enable_arenas = true;
option java_outer_classname = "AttrValueProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework";
import "tensorflow/core/framework/tensor.proto";
import "tensorflow/core/framework/tensor_shape.proto";
import "tensorflow/core/framework/types.proto";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/attr_value_go_proto";

// Protocol buffer representing the value for an attr used to configure an Op.
// Comment indicates the corresponding attr type. Only the field matching the
Expand Down
8 changes: 5 additions & 3 deletions tensorflow/core/framework/cost_graph.proto
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
syntax = "proto3";

package tensorflow;

import "tensorflow/core/framework/tensor_shape.proto";
import "tensorflow/core/framework/types.proto";

option cc_enable_arenas = true;
option java_outer_classname = "CostGraphProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework";
import "tensorflow/core/framework/tensor_shape.proto";
import "tensorflow/core/framework/types.proto";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/cost_graph_go_proto";

message CostGraphDef {
message Node {
Expand Down
9 changes: 5 additions & 4 deletions tensorflow/core/framework/device_attributes.proto
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
syntax = "proto3";

package tensorflow;

option cc_enable_arenas = true;
option java_outer_classname = "DeviceAttributesProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/device_attributes_go_proto";

message InterconnectLink {
int32 device_id = 1;
string type = 2;
int32 strength = 3;
};
}

message LocalLinks {
repeated InterconnectLink link = 1;
};
}

message DeviceLocality {
// Optional bus locality of device. Default value of 0 means
Expand All @@ -27,7 +28,7 @@ message DeviceLocality {

// Optional local interconnect links to other devices.
LocalLinks links = 3;
};
}

message DeviceAttributes {
// Fully specified name of the device within a cluster.
Expand Down
10 changes: 6 additions & 4 deletions tensorflow/core/framework/function.proto
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
syntax = "proto3";

package tensorflow;

import "tensorflow/core/framework/attr_value.proto";
import "tensorflow/core/framework/node_def.proto";
import "tensorflow/core/framework/op_def.proto";

option cc_enable_arenas = true;
option java_outer_classname = "FunctionProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework";
import "tensorflow/core/framework/attr_value.proto";
import "tensorflow/core/framework/node_def.proto";
import "tensorflow/core/framework/op_def.proto";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/function_go_proto";

// A library is a set of named functions.
message FunctionDefLibrary {
Expand Down
12 changes: 7 additions & 5 deletions tensorflow/core/framework/graph.proto
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
syntax = "proto3";

package tensorflow;

import "tensorflow/core/framework/function.proto";
import "tensorflow/core/framework/node_def.proto";
import "tensorflow/core/framework/versions.proto";

option cc_enable_arenas = true;
option java_outer_classname = "GraphProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework";
import "tensorflow/core/framework/node_def.proto";
import "tensorflow/core/framework/function.proto";
import "tensorflow/core/framework/versions.proto";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/graph_go_proto";

// Represents the graph of operations
message GraphDef {
Expand Down Expand Up @@ -53,4 +55,4 @@ message GraphDef {
// consumer does not start until all return values of the callee
// function are ready.
FunctionDefLibrary library = 2;
};
}
16 changes: 9 additions & 7 deletions tensorflow/core/framework/graph_transfer_info.proto
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
syntax = "proto3";

package tensorflow;

import "tensorflow/core/framework/types.proto";

option cc_enable_arenas = true;
option java_outer_classname = "GraphTransferInfoProto";
option java_multiple_files = true;
option java_package = "org.tensorflow.framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework";
import "tensorflow/core/framework/types.proto";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/graph_transfer_info_go_proto";

message GraphTransferNodeInput {
int32 node_id = 1;
Expand All @@ -20,22 +22,22 @@ message GraphTransferNodeInfo {
int32 padding_id = 5;
int32 input_count = 6;
int32 output_count = 7;
};
}
message GraphTransferConstNodeInfo {
string name = 1;
int32 node_id = 2;
repeated int64 shape = 3;
bytes data = 4;
DataType dtype = 5;
};
}
message GraphTransferNodeInputInfo {
int32 node_id = 1;
repeated GraphTransferNodeInput node_input = 2;
};
}
message GraphTransferNodeOutputInfo {
int32 node_id = 1;
repeated int32 max_byte_size = 2;
};
}
message GraphTransferGraphInputNodeInfo {
string name = 1;
repeated int64 shape = 2;
Expand Down Expand Up @@ -66,4 +68,4 @@ message GraphTransferInfo {
repeated GraphTransferGraphOutputNodeInfo graph_output_node_info = 6;
// Destination of graph transfer
Destination destination = 7;
};
}
8 changes: 5 additions & 3 deletions tensorflow/core/framework/kernel_def.proto
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
syntax = "proto3";

package tensorflow;

import "tensorflow/core/framework/attr_value.proto";

option cc_enable_arenas = true;
option java_outer_classname = "KernelDefProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework";
import "tensorflow/core/framework/attr_value.proto";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/kernel_def_go_proto";

message KernelDef {
// Must match the name of an Op.
Expand Down Expand Up @@ -43,4 +45,4 @@ message KernelDef {
// A collection of KernelDefs
message KernelList {
repeated KernelDef kernel = 1;
};
}
Loading

0 comments on commit 4221d1a

Please sign in to comment.