Adjust structure of all BUILD files to recommended style (https://docs.bazel.build/versions/master/skylark/build-style.html#file-structure), moving loads to top.

PiperOrigin-RevId: 252571477
This commit is contained in:
A. Unique TensorFlower 2019-06-11 01:28:20 -07:00 committed by TensorFlower Gardener
parent 7b924fb2a7
commit a9d52b709c
23 changed files with 94 additions and 98 deletions

View File

@ -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 = [

View File

@ -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"],

View File

@ -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(

View File

@ -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"],

View File

@ -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"],

View File

@ -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"],

View File

@ -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 = [

View File

@ -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"],

View File

@ -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 = [

View File

@ -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 = [

View File

@ -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 = [

View File

@ -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"],

View File

@ -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 = [

View File

@ -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"],

View File

@ -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,

View File

@ -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(

View File

@ -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",

View File

@ -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"],

View File

@ -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/*",
]))

View File

@ -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"],

View File

@ -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",

View File

@ -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 = [

View File

@ -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",