Skip to content

Commit

Permalink
Adjust structure of all BUILD files to recommended style (https://doc…
Browse files Browse the repository at this point in the history
…s.bazel.build/versions/master/skylark/build-style.html#file-structure), moving loads to top.

PiperOrigin-RevId: 252864999
  • Loading branch information
tensorflower-gardener committed Jun 12, 2019
1 parent a0e2b97 commit d7f09bf
Show file tree
Hide file tree
Showing 17 changed files with 84 additions and 86 deletions.
4 changes: 2 additions & 2 deletions tensorflow/cc/profiler/BUILD
@@ -1,10 +1,10 @@
load("//tensorflow:tensorflow.bzl", "tf_cuda_cc_test")

package(
default_visibility = ["//visibility:public"],
licenses = ["notice"], # Apache 2.0
)

load("//tensorflow:tensorflow.bzl", "tf_cuda_cc_test")

tf_cuda_cc_test(
name = "profiler_test",
srcs = ["profiler_test.cc"],
Expand Down
6 changes: 3 additions & 3 deletions tensorflow/compiler/aot/tests/BUILD
@@ -1,11 +1,11 @@
load("//tensorflow/compiler/aot:tfcompile.bzl", "tf_library")
load("//tensorflow:tensorflow.bzl", "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")

# We disable some tfcompile tests in the open source build with the
# "manual" tag to avoid making our OSS users build LLVM twice
# (once for host and once for target).
Expand Down
14 changes: 7 additions & 7 deletions tensorflow/compiler/tf2tensorrt/BUILD
Expand Up @@ -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_cc_shared_object",
Expand All @@ -31,6 +24,13 @@ load(
load("@local_config_tensorrt//:build_defs.bzl", "if_tensorrt")
# Placeholder for Google-internal load statements.

package(
default_visibility = ["//visibility:public"],
licenses = ["notice"], # Apache 2.0
)

exports_files(["LICENSE"])

tf_cuda_cc_test(
name = "tensorrt_test_cc",
size = "small",
Expand Down
10 changes: 5 additions & 5 deletions tensorflow/compiler/tf2xla/ops/BUILD
@@ -1,14 +1,14 @@
package(
default_visibility = ["//tensorflow:internal"],
licenses = ["notice"], # Apache 2.0
)

load(
"//tensorflow:tensorflow.bzl",
"tf_custom_op_library",
"tf_gen_op_wrapper_py",
)

package(
default_visibility = ["//tensorflow:internal"],
licenses = ["notice"], # Apache 2.0
)

cc_library(
name = "xla_ops",
srcs = ["xla_ops.cc"],
Expand Down
27 changes: 13 additions & 14 deletions tensorflow/core/distributed_runtime/BUILD
Expand Up @@ -3,6 +3,19 @@
# to be distributed and performed in parallel across multiple
# processes.

load("//tensorflow:tensorflow.bzl", "tf_cc_test", "tf_cuda_library", "tf_copts")
load("//tensorflow:tensorflow.bzl", "tf_cuda_cc_test")

# For platform specific build config
load(
"//tensorflow/core:platform/default/build_config.bzl",
"tf_kernel_tests_linkstatic",
)
load(
"//tensorflow/core:platform/default/build_config_root.bzl",
"tf_cuda_tests_tags",
)

package(
default_visibility = [
"//tensorflow:internal",
Expand All @@ -20,20 +33,6 @@ filegroup(
]),
)

load("//tensorflow:tensorflow.bzl", "tf_cc_test", "tf_cuda_library")
load("//tensorflow:tensorflow.bzl", "tf_cuda_cc_test")
load("//tensorflow:tensorflow.bzl", "tf_copts")

# For platform specific build config
load(
"//tensorflow/core:platform/default/build_config.bzl",
"tf_kernel_tests_linkstatic",
)
load(
"//tensorflow/core:platform/default/build_config_root.bzl",
"tf_cuda_tests_tags",
)

cc_library(
name = "partial_run_mgr",
srcs = ["partial_run_mgr.cc"],
Expand Down
12 changes: 6 additions & 6 deletions tensorflow/core/kernels/rnn/BUILD
@@ -1,12 +1,6 @@
# Description:
# OpKernels for RNN ops.

package(
default_visibility = ["//tensorflow:internal"],
)

licenses(["notice"]) # Apache 2.0

load(
"//tensorflow:tensorflow.bzl",
"tf_gpu_library",
Expand All @@ -17,6 +11,12 @@ load(
"if_cuda_is_configured",
)

package(
default_visibility = ["//tensorflow:internal"],
)

licenses(["notice"]) # Apache 2.0

tf_gpu_library(
name = "blas_gemm",
srcs = if_cuda_is_configured(["blas_gemm.cc"]),
Expand Down
14 changes: 7 additions & 7 deletions tensorflow/core/nccl/BUILD
Expand Up @@ -2,13 +2,6 @@
# Wrap NVIDIA (https://github.com/NVIDIA/nccl) NCCL with tensorflow ops.
# APIs are meant to change over time.

package(
default_visibility = ["//tensorflow:__subpackages__"],
licenses = ["notice"], # Apache 2.0
)

exports_files(["LICENSE"])

load("//tensorflow:tensorflow.bzl", "tf_cuda_cc_test")
load("//tensorflow:tensorflow.bzl", "tf_copts")
load("@local_config_cuda//cuda:build_defs.bzl", "if_cuda")
Expand All @@ -17,6 +10,13 @@ load(
"tf_cuda_tests_tags",
)

package(
default_visibility = ["//tensorflow:__subpackages__"],
licenses = ["notice"], # Apache 2.0
)

exports_files(["LICENSE"])

cc_library(
name = "nccl_lib",
srcs = if_cuda([
Expand Down
10 changes: 5 additions & 5 deletions tensorflow/core/profiler/internal/runtime/BUILD
@@ -1,13 +1,13 @@
package(
default_visibility = ["//tensorflow:internal"],
licenses = ["notice"], # Apache 2.0
)

load(
"//tensorflow:tensorflow.bzl",
"tf_cuda_library",
)

package(
default_visibility = ["//tensorflow:internal"],
licenses = ["notice"], # Apache 2.0
)

tf_cuda_library(
name = "eager_profiler",
srcs = [
Expand Down
8 changes: 4 additions & 4 deletions tensorflow/lite/experimental/ios/BUILD.apple
@@ -1,14 +1,14 @@
# TensorFlow Lite for iOS

load("//tensorflow/lite/experimental/ios:ios.bzl", "TFL_IOS_BUILD_VERSION", "TFL_MINIMUM_OS_VERSION")
load("@build_bazel_rules_apple//apple:ios.bzl", "ios_static_framework")
load("@build_bazel_rules_apple//apple:versioning.bzl", "apple_bundle_version")

package(
default_visibility = ["//visibility:private"],
licenses = ["notice"], # Apache 2.0
)

load("//tensorflow/lite/experimental/ios:ios.bzl", "TFL_IOS_BUILD_VERSION", "TFL_MINIMUM_OS_VERSION")
load("@build_bazel_rules_apple//apple:ios.bzl", "ios_static_framework")
load("@build_bazel_rules_apple//apple:versioning.bzl", "apple_bundle_version")

apple_bundle_version(
name = "TensorFlowLiteC_version",
build_version = TFL_IOS_BUILD_VERSION,
Expand Down
10 changes: 5 additions & 5 deletions tensorflow/lite/experimental/micro/BUILD
@@ -1,13 +1,13 @@
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_framework",
srcs = [
Expand Down
6 changes: 3 additions & 3 deletions tensorflow/lite/experimental/objc/BUILD.apple
@@ -1,13 +1,13 @@
# TensorFlow Lite for Objective-C

load("//tensorflow/lite/experimental/ios:ios.bzl", "TFL_DEFAULT_TAGS", "TFL_DISABLED_SANITIZER_TAGS", "TFL_MINIMUM_OS_VERSION")
load("@build_bazel_rules_apple//apple:ios.bzl", "ios_application", "ios_unit_test")

package(
default_visibility = ["//visibility:private"],
licenses = ["notice"], # Apache 2.0
)

load("//tensorflow/lite/experimental/ios:ios.bzl", "TFL_DEFAULT_TAGS", "TFL_DISABLED_SANITIZER_TAGS", "TFL_MINIMUM_OS_VERSION")
load("@build_bazel_rules_apple//apple:ios.bzl", "ios_application", "ios_unit_test")

SOURCES = glob([
"sources/*.h",
"sources/*.m",
Expand Down
3 changes: 1 addition & 2 deletions tensorflow/lite/java/ovic/BUILD
Expand Up @@ -2,14 +2,13 @@
# OVIC Benchmarker Java API.

load("@build_bazel_rules_android//android:rules.bzl", "android_library")
load("//tensorflow/java:build_defs.bzl", "JAVACOPTS")

package(
default_visibility = ["//visibility:public"],
licenses = ["notice"], # Apache 2.0
)

load("//tensorflow/java:build_defs.bzl", "JAVACOPTS")

# Build targets for OVIC classification.
java_test(
name = "OvicClassifierTest",
Expand Down
4 changes: 2 additions & 2 deletions tensorflow/lite/java/src/main/native/BUILD
Expand Up @@ -2,13 +2,13 @@
# Java Native Interface (JNI) library intended for implementing the
# TensorFlow Lite Java API using the TensorFlow Lite CC library.

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 = "native_framework_only",
srcs = [
Expand Down
8 changes: 4 additions & 4 deletions tensorflow/lite/toco/python/BUILD
@@ -1,3 +1,7 @@
load("//tensorflow:tensorflow.bzl", "tf_py_test")
load("//tensorflow:tensorflow.bzl", "tf_py_wrap_cc")
load("//tensorflow:tensorflow.bzl", "py_binary")

package(
default_visibility = [
"//tensorflow/lite:__subpackages__",
Expand All @@ -6,10 +10,6 @@ package(
licenses = ["notice"], # Apache 2.0
)

load("//tensorflow:tensorflow.bzl", "tf_py_wrap_cc")
load("//tensorflow:tensorflow.bzl", "tf_py_test")
load("//tensorflow:tensorflow.bzl", "py_binary")

config_setting(
name = "tflite_convert_with_select_tf_ops",
define_values = {"tflite_convert_with_select_tf_ops": "true"},
Expand Down
10 changes: 5 additions & 5 deletions tensorflow/lite/toco/tflite/BUILD
@@ -1,14 +1,14 @@
load(
"//tensorflow:tensorflow.bzl",
"tf_cc_test",
)

package(
# To suppress build cleaner error about inclusion of schema_generate.h.
features = ["-layering_check"],
licenses = ["notice"], # Apache 2.0
)

load(
"//tensorflow:tensorflow.bzl",
"tf_cc_test",
)

cc_library(
name = "operator",
srcs = [
Expand Down
10 changes: 5 additions & 5 deletions tensorflow/python/distribute/BUILD
@@ -1,15 +1,15 @@
load("//tensorflow:tensorflow.bzl", "py_test", "tf_py_test")
load("//tensorflow:tensorflow.bzl", "cuda_py_test")
load("//tensorflow/compiler/tests:build_defs.bzl", "tf_xla_py_test")
load("//tensorflow/core:platform/default/distribute.bzl", "distribute_py_test")

package(
default_visibility = ["//tensorflow:internal"],
licenses = ["notice"], # Apache 2.0
)

exports_files(["LICENSE"])

load("//tensorflow:tensorflow.bzl", "py_test", "tf_py_test")
load("//tensorflow:tensorflow.bzl", "cuda_py_test")
load("//tensorflow/compiler/tests:build_defs.bzl", "tf_xla_py_test")
load("//tensorflow/core:platform/default/distribute.bzl", "distribute_py_test")

py_library(
name = "distribute_test_lib_pip",
deps = [
Expand Down
14 changes: 7 additions & 7 deletions tensorflow/python/training/tracking/BUILD
@@ -1,6 +1,13 @@
# Description:
# Utilities for reading and writing object-based checkpoints.

load("//tensorflow:tensorflow.bzl", "tf_py_test")
load(
"//tensorflow/tools/test:performance.bzl",
"tf_py_logged_benchmark",
)
load("//tensorflow/compiler/tests:build_defs.bzl", "tf_xla_py_test")

package(
default_visibility = [
"//tensorflow:internal",
Expand All @@ -10,13 +17,6 @@ package(

exports_files(["LICENSE"])

load("//tensorflow:tensorflow.bzl", "tf_py_test")
load(
"//tensorflow/tools/test:performance.bzl",
"tf_py_logged_benchmark",
)
load("//tensorflow/compiler/tests:build_defs.bzl", "tf_xla_py_test")

py_library(
name = "base",
srcs = ["base.py"],
Expand Down

0 comments on commit d7f09bf

Please sign in to comment.