From e1a7896aaf934632eceefaaedb3f4fb9b91cfd67 Mon Sep 17 00:00:00 2001 From: William Chargin Date: Mon, 14 Sep 2020 14:04:01 -0700 Subject: [PATCH] Add `go_package` options to more proto files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Many TensorFlow proto files specify a `go_package`, but not all do. This patch adds the option to all proto files needed by TensorBoard, as given by `git grep -L go_package tensorboard/compat/proto/` (from within the TensorBoard repository). The package path follows convention: e.g., ``` $ grep go_package core/framework/summary.proto option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/summary_go_proto"; ``` Test Plan: In a TensorBoard repo, run `./tensorboard/compat/proto/update.sh PATH`, where `PATH` is the path to a TensorFlow repo with this change. Then run ``` mkdir -p out/ && find tensorboard/compat/proto/ -name '*.proto' -exec protoc --go_out=out/ {} \; ``` and note that the protos are all compiled successfully, without any “Missing 'go_package' option” warnings. PiperOrigin-RevId: 331624761 Change-Id: Ib685251bd0a2404f5d1f007579371aa231746a8d --- tensorflow/core/profiler/tfprof_log.proto | 1 + tensorflow/core/util/event.proto | 1 + tensorflow/python/framework/cpp_shape_inference.proto | 1 + 3 files changed, 3 insertions(+) diff --git a/tensorflow/core/profiler/tfprof_log.proto b/tensorflow/core/profiler/tfprof_log.proto index 90b9e293ec7..b6db47e805e 100644 --- a/tensorflow/core/profiler/tfprof_log.proto +++ b/tensorflow/core/profiler/tfprof_log.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package tensorflow.tfprof; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/profiler/tfprof_log_go_proto"; import "tensorflow/core/framework/attr_value.proto"; import "tensorflow/core/framework/step_stats.proto"; diff --git a/tensorflow/core/util/event.proto b/tensorflow/core/util/event.proto index f5dfffa671b..310d7948752 100644 --- a/tensorflow/core/util/event.proto +++ b/tensorflow/core/util/event.proto @@ -8,6 +8,7 @@ option cc_enable_arenas = true; option java_outer_classname = "EventProtos"; option java_multiple_files = true; option java_package = "org.tensorflow.util"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/util/event_go_proto"; // Protocol buffer representing an event that happened during // the execution of a Brain model. diff --git a/tensorflow/python/framework/cpp_shape_inference.proto b/tensorflow/python/framework/cpp_shape_inference.proto index 11199a9720f..1bf14570292 100644 --- a/tensorflow/python/framework/cpp_shape_inference.proto +++ b/tensorflow/python/framework/cpp_shape_inference.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package tensorflow; option cc_enable_arenas = true; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/python/framework/cpp_shape_inference_go_proto"; import "tensorflow/core/framework/types.proto"; import "tensorflow/core/framework/tensor_shape.proto";