Skip to content

Commit

Permalink
Add a "keras friends" target which contains Keras and its related pac…
Browse files Browse the repository at this point in the history
…kages.

PiperOrigin-RevId: 407429953
  • Loading branch information
qlzh727 authored and tensorflower-gardener committed Nov 3, 2021
1 parent 593c06f commit 42bf997
Show file tree
Hide file tree
Showing 32 changed files with 41 additions and 34 deletions.
10 changes: 9 additions & 1 deletion keras/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,21 @@ load("@org_keras//keras:keras.bzl", "tf_py_test")

package(
default_visibility = [
":__subpackages__",
":friends",
"//third_party/py/tensorflow:__subpackages__",
"//third_party/tensorflow_estimator:__subpackages__",
],
licenses = ["notice"],
)

# Keras code that doesn't live in core Keras directory, but still
# need to directly access the keras code.
# We shouldn't add any client side package to this list.
package_group(
name = "friends",
packages = ["//keras/..."],
)

exports_files(["LICENSE"])

config_setting(
Expand Down
2 changes: 1 addition & 1 deletion keras/api/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ load("//keras/api:api_init_files.bzl", "KERAS_API_INIT_FILES", "KERAS_API_INIT_F

package(
default_visibility = [
"//keras:__subpackages__",
"//keras:friends",
"//third_party/py/tensorflow:__subpackages__",
],
licenses = ["notice"], # Apache 2.0 License
Expand Down
2 changes: 1 addition & 1 deletion keras/applications/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ load("@org_keras//keras:keras.bzl", "tf_py_test")
package(
default_visibility = [
# Remove this deps to integration test.
"//keras:__subpackages__",
"//keras:friends",
],
licenses = ["notice"],
)
Expand Down
2 changes: 1 addition & 1 deletion keras/benchmarks/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ py_library(
name = "profiler_lib",
srcs_version = "PY3",
visibility = [
"//keras:__subpackages__",
"//keras:friends",
"//learning/brain/contrib/keras_benchmark:__subpackages__",
],
)
Expand Down
4 changes: 2 additions & 2 deletions keras/benchmarks/layer_benchmarks/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ py_library(
name = "run_xprof",
srcs = ["run_xprof.py"],
srcs_version = "PY3",
visibility = ["//keras:__subpackages__"],
visibility = ["//keras:friends"],
)

py_library(
name = "layer_benchmarks_test_base",
srcs = ["layer_benchmarks_test_base.py"],
srcs_version = "PY3",
visibility = ["//keras:__subpackages__"],
visibility = ["//keras:friends"],
deps = [
":run_xprof",
"//:expect_tensorflow_installed",
Expand Down
2 changes: 1 addition & 1 deletion keras/datasets/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

package(
default_visibility = [
"//keras:__subpackages__",
"//keras:friends",
],
licenses = ["notice"],
)
Expand Down
2 changes: 1 addition & 1 deletion keras/distribute/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ load("@org_keras//keras:keras.bzl", "tf_py_test") # buildifier: disable=same-or
package(
# TODO(scottzhu): Remove this deps when distribute test are converted to integration test.
default_visibility = [
"//keras:__subpackages__",
"//keras:friends",
"//third_party/tensorflow/python/distribute:__pkg__",
"//third_party/tensorflow/tools/pip_package:__pkg__",
],
Expand Down
2 changes: 1 addition & 1 deletion keras/engine/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ load("@org_keras//keras:keras.bzl", "cuda_py_test")
package(
# TODO(scottzhu): Remove non-keras deps from TF.
default_visibility = [
"//keras:__subpackages__",
"//keras:friends",
"//third_party/tensorflow/python:__pkg__",
"//third_party/tensorflow/python/feature_column:__pkg__",
],
Expand Down
2 changes: 1 addition & 1 deletion keras/estimator/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

package(
default_visibility = [
"//keras:__subpackages__",
"//keras:friends",
],
licenses = ["notice"],
)
Expand Down
2 changes: 1 addition & 1 deletion keras/feature_column/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ load("@org_keras//keras:keras.bzl", "tf_py_test")

package(
default_visibility = [
"//keras:__subpackages__",
"//keras:friends",
"//third_party/tensorflow/python/feature_column:__subpackages__",
],
licenses = ["notice"],
Expand Down
3 changes: 1 addition & 2 deletions keras/initializers/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ load("@org_keras//keras:keras.bzl", "tf_py_test")

package(
default_visibility = [
"//keras:__subpackages__",
"//learning/brain/experimental/dtensor/python/keras:__subpackages__",
"//keras:friends",
],
licenses = ["notice"],
)
Expand Down
2 changes: 1 addition & 1 deletion keras/integration_test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ load("@org_keras//keras:keras.bzl", "distribute_py_test")

package(
default_visibility = [
"//keras:__subpackages__",
"//keras:friends",
"//third_party/tensorflow/tools/pip_package:__pkg__",
],
licenses = ["notice"],
Expand Down
2 changes: 1 addition & 1 deletion keras/layers/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ load("@org_keras//keras:keras.bzl", "tf_py_test")
package(
# TODO(scottzhu): Remove non-keras deps from TF.
default_visibility = [
"//keras:__subpackages__",
"//keras:friends",
"//third_party/tensorflow/python/distribute:__pkg__",
"//third_party/tensorflow/python/feature_column:__pkg__",
"//third_party/tensorflow/python/training/tracking:__pkg__",
Expand Down
2 changes: 1 addition & 1 deletion keras/layers/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ load("@org_keras//keras:keras.bzl", "tf_py_test")

package(
default_visibility = [
"//keras:__subpackages__",
"//keras:friends",
"//third_party/py/tensorflow_gnn:__subpackages__",
"//third_party/tensorflow/python/distribute:__pkg__",
"//third_party/tensorflow/python/feature_column:__pkg__",
Expand Down
2 changes: 1 addition & 1 deletion keras/layers/legacy_rnn/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

package(
default_visibility = [
"//keras:__subpackages__",
"//keras:friends",
"//third_party/tensorflow:__subpackages__",
],
licenses = ["notice"],
Expand Down
2 changes: 1 addition & 1 deletion keras/layers/normalization/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ load("@org_keras//keras:keras.bzl", "cuda_py_test")
package(
# TODO(scottzhu): Remove non-keras deps from TF.
default_visibility = [
"//keras:__subpackages__",
"//keras:friends",
"//third_party/tensorflow/python/distribute:__pkg__",
"//third_party/tensorflow/python/feature_column:__pkg__",
"//third_party/tensorflow/python/training/tracking:__pkg__",
Expand Down
2 changes: 1 addition & 1 deletion keras/layers/preprocessing/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ load("@org_keras//keras:keras.bzl", "distribute_py_test")

package(
default_visibility = [
"//keras:__subpackages__",
"//keras:friends",
"//third_party/tensorflow/tools/pip_package:__pkg__",
],
licenses = ["notice"],
Expand Down
2 changes: 1 addition & 1 deletion keras/layers/preprocessing/benchmarks/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ load("@org_keras//keras:keras.bzl", "tf_py_test")

package(
default_visibility = [
"//keras:__subpackages__",
"//keras:friends",
"//third_party/tensorflow/tools/pip_package:__pkg__",
],
licenses = ["notice"],
Expand Down
2 changes: 1 addition & 1 deletion keras/legacy_tf_layers/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ load("@org_keras//keras:keras.bzl", "cuda_py_test")

package(
default_visibility = [
"//keras:__subpackages__",
"//keras:friends",
"//third_party/tensorflow:__subpackages__",
],
licenses = ["notice"],
Expand Down
2 changes: 1 addition & 1 deletion keras/mixed_precision/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ package(
default_visibility = [
# TODO(scottzhu): Remove these two deps and convert the test to integration test.
"//third_party/tensorflow/python/distribute:__pkg__", # For collective_all_reduce_strategy_test
"//keras:__subpackages__",
"//keras:friends",
"//third_party/tensorflow/tools/pip_package:__pkg__",
],
licenses = ["notice"],
Expand Down
2 changes: 1 addition & 1 deletion keras/mixed_precision/testdata/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

package(
default_visibility = [
"//keras:__subpackages__",
"//keras:friends",
"//third_party/tensorflow/tools/pip_package:__pkg__",
],
licenses = ["notice"],
Expand Down
2 changes: 1 addition & 1 deletion keras/optimizer_experimental/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ load("@org_keras//keras:keras.bzl", "distribute_py_test")

package(
default_visibility = [
"//keras:__subpackages__",
"//keras:friends",
],
licenses = ["notice"],
)
Expand Down
2 changes: 1 addition & 1 deletion keras/optimizer_v2/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ load("@org_keras//keras:keras.bzl", "cuda_py_test")
package(
# TODO(scottzhu): Remove non-keras deps from TF.
default_visibility = [
"//keras:__subpackages__",
"//keras:friends",
"//third_party/tensorflow/python:__pkg__",
"//third_party/tensorflow/python/distribute:__pkg__",
"//third_party/tensorflow/python/training/tracking:__pkg__",
Expand Down
2 changes: 1 addition & 1 deletion keras/premade/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ load("@org_keras//keras:keras.bzl", "tf_py_test")

package(
default_visibility = [
"//keras:__subpackages__",
"//keras:friends",
],
licenses = ["notice"],
)
Expand Down
2 changes: 1 addition & 1 deletion keras/preprocessing/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ load("@org_keras//keras:keras.bzl", "tf_py_test")

package(
default_visibility = [
"//keras:__subpackages__",
"//keras:friends",
],
licenses = ["notice"],
)
Expand Down
2 changes: 1 addition & 1 deletion keras/protobuf/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ load("@com_google_protobuf//:protobuf.bzl", "py_proto_library")

package(
default_visibility = [
"//keras:__subpackages__",
"//keras:friends",
],
licenses = ["notice"], # Apache 2.0
)
Expand Down
2 changes: 1 addition & 1 deletion keras/saving/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ load("@org_keras//keras:keras.bzl", "tf_py_test")
package(
# TODO(scottzhu): Remove non-keras deps from TF.
default_visibility = [
"//keras:__subpackages__",
"//keras:friends",
"//third_party/tensorflow/python/distribute:__pkg__",
],
licenses = ["notice"],
Expand Down
2 changes: 1 addition & 1 deletion keras/saving/utils_v1/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

package(
default_visibility = [
"//keras:__subpackages__",
"//keras:friends",
],
licenses = ["notice"],
)
Expand Down
2 changes: 1 addition & 1 deletion keras/tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ load("@org_keras//keras:keras.bzl", "tpu_py_test")

package(
default_visibility = [
"//keras:__subpackages__",
"//keras:friends",
"//third_party/tensorflow/tools/pip_package:__pkg__",
],
licenses = ["notice"],
Expand Down
2 changes: 1 addition & 1 deletion keras/type/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package(
default_visibility = ["//keras:__subpackages__"],
default_visibility = ["//keras:friends"],
licenses = ["notice"],
)

Expand Down
2 changes: 1 addition & 1 deletion keras/utils/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ load("@org_keras//keras:keras.bzl", "tf_py_test")
package(
# TODO(scottzhu): Remove non-keras deps from TF.
default_visibility = [
"//keras:__subpackages__",
"//keras:friends",
"//third_party/tensorflow/python/feature_column:__pkg__",
"//third_party/tensorflow/tools/pip_package:__pkg__",
],
Expand Down
2 changes: 1 addition & 1 deletion keras/wrappers/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
load("@org_keras//keras:keras.bzl", "tf_py_test")

package(
default_visibility = ["//keras:__subpackages__"],
default_visibility = ["//keras:friends"],
licenses = ["notice"],
)

Expand Down

0 comments on commit 42bf997

Please sign in to comment.