diff --git a/tensorflow/cc/BUILD b/tensorflow/cc/BUILD index c5e1262cec3..e335931e409 100644 --- a/tensorflow/cc/BUILD +++ b/tensorflow/cc/BUILD @@ -2,6 +2,16 @@ # TensorFlow is a computational framework, primarily for use in machine # learning applications. +load( + "//tensorflow:tensorflow.bzl", + "cc_library_with_android_deps", + "tf_cc_binary", + "tf_cc_test", + "tf_copts", + "tf_gen_op_wrappers_cc", + "transitive_hdrs", +) + package( default_visibility = ["//visibility:public"], licenses = ["notice"], # Apache 2.0 @@ -20,16 +30,6 @@ filegroup( ], ) -load( - "//tensorflow:tensorflow.bzl", - "cc_library_with_android_deps", - "tf_cc_binary", - "tf_cc_test", - "tf_copts", - "tf_gen_op_wrappers_cc", - "transitive_hdrs", -) - cc_library( name = "gradients", srcs = [ diff --git a/tensorflow/cc/tools/BUILD b/tensorflow/cc/tools/BUILD index 8e509aeeae8..a192c4bdb18 100644 --- a/tensorflow/cc/tools/BUILD +++ b/tensorflow/cc/tools/BUILD @@ -1,6 +1,11 @@ # Description: # TensorFlow cc tools. +load( + "//tensorflow:tensorflow.bzl", + "tf_cc_test", +) + package( default_visibility = ["//visibility:public"], licenses = ["notice"], # Apache 2.0 @@ -8,11 +13,6 @@ package( exports_files(["LICENSE"]) -load( - "//tensorflow:tensorflow.bzl", - "tf_cc_test", -) - cc_library( name = "freeze_saved_model", srcs = ["freeze_saved_model.cc"], diff --git a/tensorflow/compiler/aot/BUILD b/tensorflow/compiler/aot/BUILD index 7ef9dd4a0de..22c360fe765 100644 --- a/tensorflow/compiler/aot/BUILD +++ b/tensorflow/compiler/aot/BUILD @@ -1,12 +1,11 @@ +load("//tensorflow/compiler/aot:tfcompile.bzl", "tf_library") +load("//tensorflow:tensorflow.bzl", "tf_cc_binary", "tf_cc_test") + package( default_visibility = ["//visibility:private"], licenses = ["notice"], # Apache 2.0 ) -load("//tensorflow/compiler/aot:tfcompile.bzl", "tf_library") -load("//tensorflow:tensorflow.bzl", "tf_cc_test") -load("//tensorflow:tensorflow.bzl", "tf_cc_binary") - # Don't depend on this directly; this is only used for the benchmark test # generated by tf_library. cc_library( diff --git a/tensorflow/compiler/xrt/BUILD b/tensorflow/compiler/xrt/BUILD index f626e211af9..67402c11fcc 100644 --- a/tensorflow/compiler/xrt/BUILD +++ b/tensorflow/compiler/xrt/BUILD @@ -1,13 +1,5 @@ # Description: Operations defined for XRT -package( - default_visibility = [ - "//learning/brain:__subpackages__", - "//tensorflow/compiler/xrt:__subpackages__", - ], - licenses = ["notice"], # Apache 2.0 -) - load( "//tensorflow:tensorflow.bzl", "tf_custom_op_py_library", @@ -20,6 +12,14 @@ load( "tf_proto_library_py", ) +package( + default_visibility = [ + "//learning/brain:__subpackages__", + "//tensorflow/compiler/xrt:__subpackages__", + ], + licenses = ["notice"], # Apache 2.0 +) + xla_proto_library( name = "xrt_proto", srcs = ["xrt.proto"], diff --git a/tensorflow/core/ops/compat/BUILD b/tensorflow/core/ops/compat/BUILD index 62d677ef899..566fa892060 100644 --- a/tensorflow/core/ops/compat/BUILD +++ b/tensorflow/core/ops/compat/BUILD @@ -2,6 +2,12 @@ # For keeping the history of OpDefs for every major version of TensorFlow, # to validate that we don't make backwards-incompatible changes. +load( + "//tensorflow:tensorflow.bzl", + "tf_cc_binary", + "tf_cc_test", +) + package( default_visibility = ["//visibility:private"], licenses = ["notice"], # Apache 2.0 @@ -9,12 +15,6 @@ package( exports_files(["LICENSE"]) -load( - "//tensorflow:tensorflow.bzl", - "tf_cc_binary", - "tf_cc_test", -) - cc_library( name = "op_compatibility_lib", srcs = ["op_compatibility_lib.cc"], diff --git a/tensorflow/core/platform/hadoop/BUILD b/tensorflow/core/platform/hadoop/BUILD index 3f94facc3cd..fc6ae4dc6b7 100644 --- a/tensorflow/core/platform/hadoop/BUILD +++ b/tensorflow/core/platform/hadoop/BUILD @@ -1,16 +1,16 @@ # Description: # Hadoop file system implementation. -package( - default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 -) - load( "//tensorflow:tensorflow.bzl", "tf_cc_test", ) +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], # Apache 2.0 +) + cc_library( name = "hadoop_file_system", srcs = ["hadoop_file_system.cc"], diff --git a/tensorflow/core/profiler/rpc/client/BUILD b/tensorflow/core/profiler/rpc/client/BUILD index 2da1b60fb9f..c876484a11d 100644 --- a/tensorflow/core/profiler/rpc/client/BUILD +++ b/tensorflow/core/profiler/rpc/client/BUILD @@ -1,10 +1,9 @@ +load("//tensorflow:tensorflow.bzl", "tf_cc_test", "tf_cuda_library") + package( licenses = ["notice"], # Apache 2.0 ) -load("//tensorflow:tensorflow.bzl", "tf_cuda_library") -load("//tensorflow:tensorflow.bzl", "tf_cc_test") - tf_cuda_library( name = "capture_profile", srcs = [ diff --git a/tensorflow/core/summary/BUILD b/tensorflow/core/summary/BUILD index 8a6401d6f99..44c9b4b8b17 100644 --- a/tensorflow/core/summary/BUILD +++ b/tensorflow/core/summary/BUILD @@ -1,11 +1,6 @@ # Description: # C++ implementation code for the summary writing APIs. -package( - default_visibility = ["//tensorflow:internal"], - licenses = ["notice"], # Apache 2.0 -) - load( "//tensorflow:tensorflow.bzl", "tf_cc_binary", @@ -13,6 +8,11 @@ load( "tf_copts", ) +package( + default_visibility = ["//tensorflow:internal"], + licenses = ["notice"], # Apache 2.0 +) + cc_library( name = "schema", srcs = ["schema.cc"], diff --git a/tensorflow/examples/multibox_detector/BUILD b/tensorflow/examples/multibox_detector/BUILD index f8c219316cb..4b1e18954fa 100644 --- a/tensorflow/examples/multibox_detector/BUILD +++ b/tensorflow/examples/multibox_detector/BUILD @@ -1,6 +1,8 @@ # Description: # TensorFlow C++ inference example for labeling images. +load("//tensorflow:tensorflow.bzl", "tf_cc_binary") + package( default_visibility = ["//tensorflow:internal"], licenses = ["notice"], # Apache 2.0 @@ -8,8 +10,6 @@ package( exports_files(["LICENSE"]) -load("//tensorflow:tensorflow.bzl", "tf_cc_binary") - tf_cc_binary( name = "detect_objects", srcs = [ diff --git a/tensorflow/java/BUILD b/tensorflow/java/BUILD index f023f7aa0db..48723f85735 100644 --- a/tensorflow/java/BUILD +++ b/tensorflow/java/BUILD @@ -1,11 +1,6 @@ # Description: # TensorFlow Java API. -package( - default_visibility = ["//visibility:private"], - licenses = ["notice"], # Apache 2.0 -) - load(":build_defs.bzl", "JAVACOPTS") load(":src/gen/gen_ops.bzl", "tf_java_op_gen_srcjar") load( @@ -18,6 +13,11 @@ load( "tf_java_test", ) +package( + default_visibility = ["//visibility:private"], + licenses = ["notice"], # Apache 2.0 +) + java_library( name = "tensorflow", srcs = [ diff --git a/tensorflow/lite/core/api/BUILD b/tensorflow/lite/core/api/BUILD index 960a7342d0f..5df9b87ce15 100644 --- a/tensorflow/lite/core/api/BUILD +++ b/tensorflow/lite/core/api/BUILD @@ -1,10 +1,10 @@ +load("//tensorflow/lite:build_def.bzl", "tflite_copts") + package( default_visibility = ["//visibility:public"], licenses = ["notice"], # Apache 2.0 ) -load("//tensorflow/lite:build_def.bzl", "tflite_copts") - cc_library( name = "api", srcs = [ diff --git a/tensorflow/lite/delegates/gpu/gl/BUILD b/tensorflow/lite/delegates/gpu/gl/BUILD index d574ea6b8bf..87e1f014523 100644 --- a/tensorflow/lite/delegates/gpu/gl/BUILD +++ b/tensorflow/lite/delegates/gpu/gl/BUILD @@ -1,11 +1,11 @@ +load("@flatbuffers//:build_defs.bzl", "flatbuffer_cc_library") +load("//tensorflow/lite:special_rules.bzl", "tflite_portable_test_suite") + package( default_visibility = ["//visibility:public"], licenses = ["notice"], # Apache 2.0 ) -load("@flatbuffers//:build_defs.bzl", "flatbuffer_cc_library") -load("//tensorflow/lite:special_rules.bzl", "tflite_portable_test_suite") - cc_library( name = "api", srcs = ["api.cc"], diff --git a/tensorflow/lite/experimental/micro/examples/micro_speech/micro_features/BUILD b/tensorflow/lite/experimental/micro/examples/micro_speech/micro_features/BUILD index 8ddb182af29..034e0b1d5ed 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_speech/micro_features/BUILD +++ b/tensorflow/lite/experimental/micro/examples/micro_speech/micro_features/BUILD @@ -1,15 +1,15 @@ # Library for generating feature vectors from audio data -package( - default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 -) - load( "//tensorflow/lite/experimental/micro/testing:micro_test.bzl", "tflite_micro_cc_test", ) +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], # Apache 2.0 +) + cc_library( name = "micro_model_settings", srcs = [ diff --git a/tensorflow/lite/experimental/microfrontend/lib/BUILD b/tensorflow/lite/experimental/microfrontend/lib/BUILD index 307395e6ea6..bff0a5fecea 100644 --- a/tensorflow/lite/experimental/microfrontend/lib/BUILD +++ b/tensorflow/lite/experimental/microfrontend/lib/BUILD @@ -1,15 +1,15 @@ # Library for generating feature vectors from audio data -package( - default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 -) - load( "//tensorflow/lite/experimental/micro/testing:micro_test.bzl", "tflite_micro_cc_test", ) +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], # Apache 2.0 +) + cc_library( name = "bits", hdrs = ["bits.h"], diff --git a/tensorflow/lite/java/src/test/native/BUILD b/tensorflow/lite/java/src/test/native/BUILD index 05fc5d6cf43..6dcdab2aeee 100644 --- a/tensorflow/lite/java/src/test/native/BUILD +++ b/tensorflow/lite/java/src/test/native/BUILD @@ -1,13 +1,13 @@ # Description: # Java Native Interface (JNI) library for testing the TensorFlow Lite Java API. +load("//tensorflow/lite:build_def.bzl", "tflite_jni_binary") + package( default_visibility = ["//visibility:public"], licenses = ["notice"], # Apache 2.0 ) -load("//tensorflow/lite:build_def.bzl", "tflite_jni_binary") - cc_library( name = "native", testonly = 1, diff --git a/tensorflow/lite/python/testdata/BUILD b/tensorflow/lite/python/testdata/BUILD index 1272db4a209..7bda81358f9 100644 --- a/tensorflow/lite/python/testdata/BUILD +++ b/tensorflow/lite/python/testdata/BUILD @@ -1,11 +1,10 @@ +load("//tensorflow/lite:build_def.bzl", "tf_to_tflite") + package( default_visibility = ["//tensorflow:internal"], licenses = ["notice"], # Apache 2.0 ) -load("//tensorflow:tensorflow.bzl", "py_test") -load("//tensorflow/lite:build_def.bzl", "tf_to_tflite") - exports_files(glob(["*.pb"])) tf_to_tflite( diff --git a/tensorflow/lite/schema/BUILD b/tensorflow/lite/schema/BUILD index 261682727c2..46ce96993b2 100644 --- a/tensorflow/lite/schema/BUILD +++ b/tensorflow/lite/schema/BUILD @@ -1,12 +1,13 @@ +load("//tensorflow:tensorflow.bzl", "py_test") +load("//tensorflow/lite:special_rules.bzl", "tflite_portable_test_suite") +load("@flatbuffers//:build_defs.bzl", "flatbuffer_cc_library") + package(default_visibility = [ "//visibility:public", ]) licenses(["notice"]) # Apache 2.0 -load("//tensorflow:tensorflow.bzl", "py_test") -load("//tensorflow/lite:special_rules.bzl", "tflite_portable_test_suite") - py_binary( name = "upgrade_schema", srcs = ["upgrade_schema.py"], @@ -58,8 +59,6 @@ exports_files([ "schema_v3.fbs", ]) -load("@flatbuffers//:build_defs.bzl", "flatbuffer_cc_library") - # Generic schema for inference on device. flatbuffer_cc_library( name = "schema_fbs", diff --git a/tensorflow/lite/toco/BUILD b/tensorflow/lite/toco/BUILD index 9aaacf9f365..2dcd75cef0b 100644 --- a/tensorflow/lite/toco/BUILD +++ b/tensorflow/lite/toco/BUILD @@ -1,8 +1,3 @@ -package( - default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 -) - load( "//tensorflow/core:platform/default/build_config.bzl", "tf_proto_library_cc", @@ -15,6 +10,11 @@ load( "tf_copts", ) +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], # Apache 2.0 +) + tf_proto_library_cc( name = "types_proto", srcs = ["types.proto"], diff --git a/tensorflow/python/compiler/tensorrt/BUILD b/tensorflow/python/compiler/tensorrt/BUILD index 013cd65f9c1..6e46165f84b 100644 --- a/tensorflow/python/compiler/tensorrt/BUILD +++ b/tensorflow/python/compiler/tensorrt/BUILD @@ -3,13 +3,6 @@ # and provide TensorRT operators and converter package. # APIs are meant to change over time. -package( - default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 -) - -exports_files(["LICENSE"]) - load( "//tensorflow:tensorflow.bzl", "tf_copts", @@ -21,6 +14,13 @@ load( "if_tensorrt", ) +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], # Apache 2.0 +) + +exports_files(["LICENSE"]) + exports_files(glob([ "test/testdata/*", ])) diff --git a/tensorflow/python/data/experimental/benchmarks/BUILD b/tensorflow/python/data/experimental/benchmarks/BUILD index 7021a82378c..683d3eca158 100644 --- a/tensorflow/python/data/experimental/benchmarks/BUILD +++ b/tensorflow/python/data/experimental/benchmarks/BUILD @@ -1,3 +1,5 @@ +load("//tensorflow:tensorflow.bzl", "py_test") + package( default_visibility = ["//tensorflow:internal"], licenses = ["notice"], # Apache 2.0 @@ -5,8 +7,6 @@ package( exports_files(["LICENSE"]) -load("//tensorflow:tensorflow.bzl", "py_test") - py_test( name = "autotune_benchmark", srcs = ["autotune_benchmark.py"], diff --git a/tensorflow/python/kernel_tests/linalg/BUILD b/tensorflow/python/kernel_tests/linalg/BUILD index 139458c1cc0..2464a280b49 100644 --- a/tensorflow/python/kernel_tests/linalg/BUILD +++ b/tensorflow/python/kernel_tests/linalg/BUILD @@ -1,12 +1,12 @@ # Tests of TensorFlow kernels written using the Python API. +load("//tensorflow:tensorflow.bzl", "cuda_py_test") + package( default_visibility = ["//tensorflow:internal"], licenses = ["notice"], # Apache 2.0 ) -load("//tensorflow:tensorflow.bzl", "cuda_py_test") - cuda_py_test( name = "linear_operator_test", size = "small", diff --git a/tensorflow/python/ops/losses/BUILD b/tensorflow/python/ops/losses/BUILD index 883fc03bbc3..d513aea70f4 100644 --- a/tensorflow/python/ops/losses/BUILD +++ b/tensorflow/python/ops/losses/BUILD @@ -1,3 +1,5 @@ +load("//tensorflow:tensorflow.bzl", "py_test") + package( default_visibility = [ "//engedu/ml/tf_from_scratch:__pkg__", @@ -6,8 +8,6 @@ package( licenses = ["notice"], # Apache 2.0 ) -load("//tensorflow:tensorflow.bzl", "py_test") - py_library( name = "losses", srcs = [ diff --git a/tensorflow/tools/mlpbtxt/BUILD b/tensorflow/tools/mlpbtxt/BUILD index f17d7511f42..68966404730 100644 --- a/tensorflow/tools/mlpbtxt/BUILD +++ b/tensorflow/tools/mlpbtxt/BUILD @@ -2,13 +2,13 @@ # This package provides binaries that convert between multi-line and standard # pbtxt (text-serialization of protocol message) files. +load("//tensorflow:tensorflow.bzl", "tf_cc_binary") + package( default_visibility = ["//visibility:private"], licenses = ["notice"], # Apache 2.0 ) -load("//tensorflow:tensorflow.bzl", "tf_cc_binary") - exports_files([ "LICENSE", "placeholder.txt",