Merge pull request from jhseu:go_fix

PiperOrigin-RevId: 293046050
Change-Id: Ia81bf682f62293faa591d6de191dbeda3fed7138
This commit is contained in:
TensorFlower Gardener 2020-02-03 17:45:49 -08:00
commit 70e675ebcf
26 changed files with 64 additions and 31 deletions

View File

@ -8,7 +8,7 @@ option cc_enable_arenas = true;
option java_outer_classname = "ApiDefProtos";
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/api_def_go_proto";
import "tensorflow/core/framework/attr_value.proto";
// Used to specify and override the default API & behavior in the

View File

@ -5,7 +5,7 @@ option cc_enable_arenas = true;
option java_outer_classname = "OpDefProtos";
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/op_def_go_proto";
import "tensorflow/core/framework/attr_value.proto";
import "tensorflow/core/framework/types.proto";

View File

@ -5,7 +5,7 @@ option cc_enable_arenas = true;
option java_outer_classname = "TensorShapeProtos";
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/tensor_shape_go_proto";
package tensorflow;

View File

@ -5,7 +5,7 @@ option cc_enable_arenas = true;
option java_outer_classname = "TypesProtos";
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/types_go_proto";
// (== suppress_warning documentation-presence ==)
// LINT.IfChange

View File

@ -10,6 +10,8 @@ package tensorflow;
import "google/protobuf/any.proto";
import "google/protobuf/duration.proto";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf";
message CudnnVersion {
int32 major = 1;
int32 minor = 2;

View File

@ -2,6 +2,8 @@ syntax = "proto3";
package tensorflow;
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf";
// Some of the data from AllocatorStats
message MemAllocatorStats {
int64 num_allocs = 1;
@ -9,7 +11,7 @@ message MemAllocatorStats {
int64 peak_bytes_in_use = 3;
int64 largest_alloc_size = 4;
float fragmentation_metric = 5;
};
}
message MemChunk {
uint64 address = 1;
@ -21,7 +23,7 @@ message MemChunk {
uint64 action_count = 7;
bool in_use = 8;
uint64 step_id = 9;
};
}
message BinSummary {
int32 bin = 1;
@ -42,4 +44,4 @@ message MemoryDump {
repeated MemChunk chunk = 3;
repeated SnapShot snap_shot = 4;
MemAllocatorStats stats = 5;
};
}

View File

@ -6,6 +6,8 @@ package tensorflow;
import "tensorflow/stream_executor/dnn.proto";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf";
// A convolution. Currently it's only used for logging. In the future, we may
// want to use it in the API as well.
message ConvolutionProto {

View File

@ -10,6 +10,8 @@ option java_outer_classname = "DebugEventProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.util";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf";
// Available modes for extracting debugging information from a Tensor.
// TODO(cais): Document the detailed column names and semantics in a separate
// markdown file once the implementation settles.

View File

@ -22,6 +22,8 @@ option java_outer_classname = "DeviceFiltersProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.distruntime";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf";
// This file contains protos to be used when defining a TensorFlow
// cluster.
//

View File

@ -11,6 +11,8 @@ import "tensorflow/core/framework/versions.proto";
import "tensorflow/core/protobuf/remote_tensor_handle.proto";
import "tensorflow/core/protobuf/tensorflow_server.proto";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf";
// A proto representation of an eager operation.
message Operation {
// A unique identifier for the operation. Set by the client so that the client

View File

@ -7,6 +7,8 @@ option java_outer_classname = "GraphDebugInfoProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf";
message GraphDebugInfo {
// This represents a file/line location in the source code.
message FileLineCol {

View File

@ -10,6 +10,8 @@ option java_outer_classname = "RemoteTensorHandleProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf";
message ResourceDtypeAndShape {
DataType dtype = 1;
TensorShapeProto shape = 2;

View File

@ -6,6 +6,8 @@ import "tensorflow/core/protobuf/master.proto";
option cc_enable_arenas = true;
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf";
// Records the creation of a new replay session. We record the device listing
// here to capture the state of the cluster.
message NewReplaySession {

View File

@ -1,15 +1,17 @@
syntax = "proto3";
import "tensorflow/core/protobuf/trackable_object_graph.proto";
import "tensorflow/core/protobuf/struct.proto";
package tensorflow;
import "tensorflow/core/framework/tensor_shape.proto";
import "tensorflow/core/framework/types.proto";
import "tensorflow/core/framework/versions.proto";
import "tensorflow/core/framework/variable.proto";
import "tensorflow/core/framework/versions.proto";
import "tensorflow/core/protobuf/struct.proto";
import "tensorflow/core/protobuf/trackable_object_graph.proto";
option cc_enable_arenas = true;
package tensorflow;
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf";
// A SavedObjectGraph is part of object-based SavedModels in TF 2.0. It
// describes the directed graph of Python objects (or equivalent in other
@ -37,8 +39,7 @@ message SavedObject {
// graph.
//
// Note: currently only valid if kind == "user_object".
repeated TrackableObjectGraph.TrackableObject.ObjectReference
children = 1;
repeated TrackableObjectGraph.TrackableObject.ObjectReference children = 1;
// Removed when forking SavedObject from TrackableObjectGraph.
reserved "attributes";

View File

@ -2,6 +2,8 @@ syntax = "proto3";
package tensorflow;
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf";
import "tensorflow/core/framework/tensor_shape.proto";
import "tensorflow/core/framework/types.proto";

View File

@ -7,6 +7,8 @@ option java_outer_classname = "TraceEventsProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf";
// A 'Trace' contains metadata for the individual traces of a system.
message Trace {
// The devices that this trace has information about. Maps from device_id to

View File

@ -1,8 +1,10 @@
syntax = "proto3";
package tensorflow;
option cc_enable_arenas = true;
package tensorflow;
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf";
// A TensorBundle addition which saves extra information about the objects which
// own variables, allowing for more robust checkpoint loading into modified

View File

@ -2,7 +2,9 @@ syntax = "proto3";
package tensorflow;
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf";
// Extra data needed on a non-RDMA RecvBufResponse.
message RecvBufRespExtra {
repeated bytes tensor_content = 1;
};
}

View File

@ -51,8 +51,12 @@ fi
# Ensure that protoc-gen-go is available in $PATH
# Since ${PROTOC} will require it.
export PATH=$PATH:${GOPATH}/bin
mkdir -p ./internal/proto
${PROTOC} \
-I ${TF_DIR} \
--go_out=./internal/proto \
${TF_DIR}/tensorflow/core/framework/*.proto
mkdir -p ../vendor
for FILE in ${TF_DIR}/tensorflow/core/framework/*.proto \
${TF_DIR}/tensorflow/core/protobuf/*.proto \
${TF_DIR}/tensorflow/stream_executor/*.proto; do
${PROTOC} \
-I ${TF_DIR} \
--go_out=../vendor \
$FILE
done

View File

@ -31,8 +31,8 @@ import (
"unsafe"
"github.com/golang/protobuf/proto"
adpb "github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core/framework/api_def_go_proto"
odpb "github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core/framework/op_def_go_proto"
adpb "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/api_def_go_proto"
odpb "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/op_def_go_proto"
)
// Encapsulates a collection of API definitions.

View File

@ -47,8 +47,8 @@ import (
"unsafe"
"github.com/golang/protobuf/proto"
adpb "github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core/framework/api_def_go_proto"
odpb "github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core/framework/op_def_go_proto"
adpb "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/api_def_go_proto"
odpb "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/op_def_go_proto"
)
// GenerateFunctionsForRegisteredOps writes a Go source code file to w

View File

@ -22,8 +22,8 @@ import (
"testing"
"github.com/golang/protobuf/proto"
adpb "github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core/framework/api_def_go_proto"
odpb "github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core/framework/op_def_go_proto"
adpb "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/api_def_go_proto"
odpb "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/op_def_go_proto"
)
// Creates an ApiDef based on opdef and applies overrides

View File

@ -22,7 +22,7 @@ import (
"github.com/golang/protobuf/proto"
tfpb "github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core"
tfpb "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf"
)
// #include <stdlib.h>

View File

@ -16,7 +16,7 @@ limitations under the License.
package tensorflow
import tfpb "github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core"
import tfpb "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf"
// #include "tensorflow/c/c_api.h"
import "C"

View File

@ -20,9 +20,9 @@ import (
"fmt"
"testing"
tspb "github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core/framework/tensor_shape_go_proto"
typb "github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core/framework/types_go_proto"
tfpb "github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core"
tspb "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/tensor_shape_go_proto"
typb "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/types_go_proto"
tfpb "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf"
)
func TestSignatureFromProto(t *testing.T) {

View File

@ -3,6 +3,8 @@ syntax = "proto3";
package stream_executor.dnn;
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/stream_executor";
// Specifies the data type used by an operation.
enum DataType {
kFloat = 0;