Skip to content

Commit

Permalink
Remove the TF proto rules from OSS keras.
Browse files Browse the repository at this point in the history
This is the last org_tensorflow deps in keras. We replace it with py_proto_library from protobuf repo.

PiperOrigin-RevId: 364469565
  • Loading branch information
qlzh727 authored and tensorflower-gardener committed Mar 23, 2021
1 parent 1c2840f commit 2d2e738
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 15 deletions.
9 changes: 9 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ http_archive(
],
)

http_archive(
name = "com_google_protobuf",
sha256 = "b10bf4e2d1a7586f54e64a5d9e7837e5188fc75ae69e36f215eb01def4f9721b",
strip_prefix = "protobuf-3.15.3",
urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.15.3.tar.gz"],
)
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
protobuf_deps()

# TF package is used as dependency for protobuf and bzl files. It is NOT used
# for python dependency.
http_archive(
Expand Down
2 changes: 1 addition & 1 deletion keras/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ py_library(
"//:expect_tensorflow_installed",
"//keras/distribute:distributed_file_utils",
"//keras/distribute:worker_training_state",
"//keras/protobuf:projector_config_proto_py",
"//keras/protobuf:projector_config_proto_py_pb2",
"//keras/utils:engine_utils",
"//keras/utils:mode_keys",
],
Expand Down
24 changes: 11 additions & 13 deletions keras/protobuf/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Description:
# Contains Keras protobufs
load("@org_tensorflow//tensorflow/core/platform:build_config.bzl", "tf_proto_library")

load("@com_google_protobuf//:protobuf.bzl", "py_proto_library")

package(
default_visibility = [
Expand All @@ -9,21 +10,18 @@ package(
licenses = ["notice"], # Apache 2.0
)

tf_proto_library(
name = "projector_config_proto",
srcs = ["projector_config.proto"],
cc_api_version = 2,
py_proto_library(
name = "saved_metadata_proto_py_pb2",
srcs = ["saved_metadata.proto"],
deps = [":versions_proto_py_pb2"],
)

tf_proto_library(
name = "saved_metadata_proto",
srcs = ["saved_metadata.proto"],
cc_api_version = 2,
protodeps = [":versions_proto"],
py_proto_library(
name = "projector_config_proto_py_pb2",
srcs = ["projector_config.proto"],
)

tf_proto_library(
name = "versions_proto",
py_proto_library(
name = "versions_proto_py_pb2",
srcs = ["versions.proto"],
cc_api_version = 2,
)
2 changes: 1 addition & 1 deletion keras/saving/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ py_library(
"//keras:regularizers",
"//keras/engine:input_spec",
"//keras/mixed_precision:autocast_variable",
"//keras/protobuf:saved_metadata_proto_py",
"//keras/protobuf:saved_metadata_proto_py_pb2",
"//keras/saving/utils_v1",
"//keras/utils:engine_utils",
"//keras/utils:metrics_utils",
Expand Down

0 comments on commit 2d2e738

Please sign in to comment.