From 75d7b02b01d35285a15cd5c3ff8cf4be66abdb78 Mon Sep 17 00:00:00 2001 From: Martin Wicke Date: Fri, 8 Apr 2016 07:54:29 -0800 Subject: [PATCH] Add BUILD files to opensource tree. Opensource all_opensource_files. Fix dependencies of custom op build rule. Change: 119376509 --- tensorflow/BUILD | 62 ++++++- tensorflow/contrib/ffmpeg/OWNERS | 3 - tensorflow/contrib/lookup/OWNERS | 3 - tensorflow/core/ops/OWNERS | 1 - .../core/platform/default/build_config/BUILD | 12 ++ tensorflow/g3doc/how_tos/adding_an_op/BUILD | 156 ++++++++++++++++++ tensorflow/tensorboard/.gitignore | 1 + tensorflow/tensorboard/app/BUILD | 19 +++ tensorflow/tensorboard/components/BUILD | 18 ++ tensorflow/tensorboard/lib/BUILD | 22 +++ tensorflow/tensorboard/lib/js/BUILD | 12 ++ tensorflow/tensorflow.bzl | 11 +- tensorflow/tools/docker/notebooks/BUILD | 17 ++ tensorflow/user_ops/BUILD | 1 - 14 files changed, 324 insertions(+), 14 deletions(-) delete mode 100644 tensorflow/contrib/ffmpeg/OWNERS delete mode 100644 tensorflow/contrib/lookup/OWNERS delete mode 100644 tensorflow/core/ops/OWNERS create mode 100644 tensorflow/g3doc/how_tos/adding_an_op/BUILD create mode 100644 tensorflow/tensorboard/app/BUILD create mode 100644 tensorflow/tensorboard/components/BUILD create mode 100644 tensorflow/tensorboard/lib/BUILD create mode 100644 tensorflow/tensorboard/lib/js/BUILD create mode 100644 tensorflow/tools/docker/notebooks/BUILD diff --git a/tensorflow/BUILD b/tensorflow/BUILD index d3e222eecbb..2978ee342c4 100644 --- a/tensorflow/BUILD +++ b/tensorflow/BUILD @@ -11,8 +11,6 @@ exports_files([ "ACKNOWLEDGMENTS", ]) -# open source marker; do not remove - # Config setting for determining if we are building for Android. config_setting( name = "android", @@ -52,6 +50,66 @@ filegroup( visibility = ["//tensorflow:__subpackages__"], ) +filegroup( + name = "all_opensource_files", + data = [ + ":all_files", + "//tensorflow/cc:all_files", + "//tensorflow/contrib:all_files", + "//tensorflow/contrib/ctc:all_files", + "//tensorflow/contrib/distributions:all_files", + "//tensorflow/contrib/framework:all_files", + "//tensorflow/contrib/layers:all_files", + "//tensorflow/contrib/linear_optimizer:all_files", + "//tensorflow/contrib/linear_optimizer/kernels:all_files", + "//tensorflow/contrib/lookup:all_files", + "//tensorflow/contrib/losses:all_files", + "//tensorflow/contrib/metrics:all_files", + "//tensorflow/contrib/skflow:all_files", + "//tensorflow/contrib/tensor_forest:all_files", + "//tensorflow/contrib/testing:all_files", + "//tensorflow/contrib/util:all_files", + "//tensorflow/core:all_files", + "//tensorflow/core/distributed_runtime:all_files", + "//tensorflow/core/distributed_runtime/rpc:all_files", + "//tensorflow/core/kernels:all_files", + "//tensorflow/core/ops/compat:all_files", + "//tensorflow/core/platform/default/build_config:all_files", + "//tensorflow/core/util/ctc:all_files", + "//tensorflow/examples/android:all_files", + "//tensorflow/examples/how_tos/reading_data:all_files", + "//tensorflow/examples/image_retraining:all_files", + "//tensorflow/examples/label_image:all_files", + "//tensorflow/examples/tutorials/mnist:all_files", + "//tensorflow/examples/tutorials/word2vec:all_files", + "//tensorflow/g3doc/how_tos/adding_an_op:all_files", + "//tensorflow/g3doc/tutorials:all_files", + "//tensorflow/models/embedding:all_files", + "//tensorflow/models/image/alexnet:all_files", + "//tensorflow/models/image/cifar10:all_files", + "//tensorflow/models/image/imagenet:all_files", + "//tensorflow/models/image/mnist:all_files", + "//tensorflow/models/rnn:all_files", + "//tensorflow/models/rnn/ptb:all_files", + "//tensorflow/models/rnn/translate:all_files", + "//tensorflow/python:all_files", + "//tensorflow/python/tools:all_files", + "//tensorflow/tensorboard:all_files", + "//tensorflow/tensorboard/app:all_files", + "//tensorflow/tensorboard/backend:all_files", + "//tensorflow/tensorboard/components:all_files", + "//tensorflow/tensorboard/lib:all_files", + "//tensorflow/tensorboard/lib/python:all_files", + "//tensorflow/tensorboard/scripts:all_files", + "//tensorflow/tools/docker:all_files", + "//tensorflow/tools/docker/notebooks:all_files", + "//tensorflow/tools/docs:all_files", + "//tensorflow/tools/test:all_files", + "//tensorflow/user_ops:all_files", + ], + visibility = [":__subpackages__"], +) + # ------------------------------------------- # New rules should be added above this target. # ------------------------------------------- diff --git a/tensorflow/contrib/ffmpeg/OWNERS b/tensorflow/contrib/ffmpeg/OWNERS deleted file mode 100644 index ca396934888..00000000000 --- a/tensorflow/contrib/ffmpeg/OWNERS +++ /dev/null @@ -1,3 +0,0 @@ -adarob -deck -fredbertsch diff --git a/tensorflow/contrib/lookup/OWNERS b/tensorflow/contrib/lookup/OWNERS deleted file mode 100644 index d11247df34f..00000000000 --- a/tensorflow/contrib/lookup/OWNERS +++ /dev/null @@ -1,3 +0,0 @@ -yleon -ptucker -mdb-group:ami \ No newline at end of file diff --git a/tensorflow/core/ops/OWNERS b/tensorflow/core/ops/OWNERS deleted file mode 100644 index 871b7d306df..00000000000 --- a/tensorflow/core/ops/OWNERS +++ /dev/null @@ -1 +0,0 @@ -per-file ops.pbtxt,compat/ops_history.*=tensorflow-git-owners diff --git a/tensorflow/core/platform/default/build_config/BUILD b/tensorflow/core/platform/default/build_config/BUILD index 69a36490b9e..4cd3a6e1522 100644 --- a/tensorflow/core/platform/default/build_config/BUILD +++ b/tensorflow/core/platform/default/build_config/BUILD @@ -78,3 +78,15 @@ cc_library( "//third_party/gpus/cuda:cudart", ], ) + +filegroup( + name = "all_files", + srcs = glob( + ["**/*"], + exclude = [ + "**/METADATA", + "**/OWNERS", + ], + ), + visibility = ["//tensorflow:__subpackages__"], +) diff --git a/tensorflow/g3doc/how_tos/adding_an_op/BUILD b/tensorflow/g3doc/how_tos/adding_an_op/BUILD new file mode 100644 index 00000000000..37793fcc63c --- /dev/null +++ b/tensorflow/g3doc/how_tos/adding_an_op/BUILD @@ -0,0 +1,156 @@ +# Description: +# Code examples referenced by adding_an_op + +package( + default_visibility = ["//tensorflow:internal"], + features = [ + "-layering_check", + "-parse_headers", + ], +) + +licenses(["notice"]) # Apache 2.0 + +load("//tensorflow:tensorflow.bzl", "tf_custom_op_library") +load("//tensorflow:tensorflow.bzl", "tf_cuda_tests_tags") + +exports_files(["LICENSE"]) + +tf_custom_op_library( + name = "zero_out_op_kernel_1.so", + srcs = ["zero_out_op_kernel_1.cc"], +) + +py_library( + name = "zero_out_op_1", + srcs = ["zero_out_op_1.py"], + data = [":zero_out_op_kernel_1.so"], + srcs_version = "PY2AND3", +) + +tf_custom_op_library( + name = "zero_out_op_kernel_2.so", + srcs = ["zero_out_op_kernel_2.cc"], +) + +py_library( + name = "zero_out_op_2", + srcs = ["zero_out_op_2.py"], + data = [":zero_out_op_kernel_2.so"], + srcs_version = "PY2AND3", +) + +tf_custom_op_library( + name = "zero_out_op_kernel_3.so", + srcs = ["zero_out_op_kernel_3.cc"], +) + +py_library( + name = "zero_out_op_3", + srcs = ["zero_out_op_3.py"], + data = [":zero_out_op_kernel_3.so"], + srcs_version = "PY2AND3", +) + +py_library( + name = "zero_out_grad_2", + srcs = ["zero_out_grad_2.py"], + srcs_version = "PY2AND3", + deps = [ + ":zero_out_op_2", + "//tensorflow:tensorflow_py", + ], +) + +py_test( + name = "zero_out_1_test", + size = "small", + srcs = ["zero_out_1_test.py"], + srcs_version = "PY2AND3", + tags = ["noasan"], + deps = [ + ":zero_out_op_1", + "//tensorflow:tensorflow_py", + ], +) + +py_test( + name = "zero_out_2_test", + size = "small", + srcs = ["zero_out_2_test.py"], + srcs_version = "PY2AND3", + tags = ["noasan"], + deps = [ + ":zero_out_grad_2", + ":zero_out_op_2", + "//tensorflow:tensorflow_py", + "//tensorflow/python:kernel_tests/gradient_checker", + ], +) + +py_test( + name = "zero_out_3_test", + size = "small", + srcs = ["zero_out_3_test.py"], + srcs_version = "PY2AND3", + tags = ["noasan"], + deps = [ + ":zero_out_op_3", + "//tensorflow:tensorflow_py", + ], +) + +tf_custom_op_library( + name = "cuda_op_kernel.so", + srcs = ["cuda_op_kernel.cc"], + gpu_srcs = ["cuda_op_kernel.cu.cc"], +) + +py_library( + name = "cuda_op", + srcs = ["cuda_op.py"], + data = [":cuda_op_kernel.so"], + srcs_version = "PY2AND3", +) + +py_test( + name = "cuda_op_test", + size = "small", + srcs = ["cuda_op_test.py"], + srcs_version = "PY2AND3", + tags = tf_cuda_tests_tags(), + deps = [ + ":cuda_op", + "//tensorflow:tensorflow_py", + ], +) + +py_test( + name = "fact_test", + size = "small", + srcs = ["fact_test.py"], + srcs_version = "PY2AND3", + deps = [ + "//tensorflow:tensorflow_py", + ], +) + +cc_binary( + name = "attr_examples", + srcs = ["attr_examples.cc"], + deps = [ + "//tensorflow/core", + ], +) + +filegroup( + name = "all_files", + srcs = glob( + ["**/*"], + exclude = [ + "**/METADATA", + "**/OWNERS", + ], + ), + visibility = ["//tensorflow:__subpackages__"], +) diff --git a/tensorflow/tensorboard/.gitignore b/tensorflow/tensorboard/.gitignore index 7616bb98281..7191fc167b4 100644 --- a/tensorflow/tensorboard/.gitignore +++ b/tensorflow/tensorboard/.gitignore @@ -11,6 +11,7 @@ components/* # in gulpfile.js !components/tf-* !components/index.html +!components/BUILD # Ignore the sample graph files since they are too large to # be in the repo. components/tf-graph/demo/tf_model_zoo/* diff --git a/tensorflow/tensorboard/app/BUILD b/tensorflow/tensorboard/app/BUILD new file mode 100644 index 00000000000..9afcd23e9e7 --- /dev/null +++ b/tensorflow/tensorboard/app/BUILD @@ -0,0 +1,19 @@ +# Description: +# Build rules for building the HTML/JS necessary for TensorBoard. +package(default_visibility = ["//tensorflow:internal"]) + +licenses(["notice"]) # Apache 2.0 + +exports_files(["LICENSE"]) + +filegroup( + name = "all_files", + srcs = glob( + ["**/*"], + exclude = [ + "**/METADATA", + "**/OWNERS", + ], + ), + visibility = ["//tensorflow:__subpackages__"], +) diff --git a/tensorflow/tensorboard/components/BUILD b/tensorflow/tensorboard/components/BUILD new file mode 100644 index 00000000000..4595cf68fde --- /dev/null +++ b/tensorflow/tensorboard/components/BUILD @@ -0,0 +1,18 @@ +package(default_visibility = ["//tensorflow:internal"]) + +licenses(["notice"]) # Apache 2.0 + +exports_files(["LICENSE"]) + +filegroup( + name = "all_files", + srcs = glob( + ["tf-*/**/*"], + exclude = [ + "**/tf_model_zoo/*", + "**/METADATA", + "**/OWNERS", + ], + ), + visibility = ["//tensorflow:__subpackages__"], +) diff --git a/tensorflow/tensorboard/lib/BUILD b/tensorflow/tensorboard/lib/BUILD new file mode 100644 index 00000000000..9c497396c68 --- /dev/null +++ b/tensorflow/tensorboard/lib/BUILD @@ -0,0 +1,22 @@ +# Description: +# BUILD rules for the static resources in TensorBoard. + +package(default_visibility = [ + "//tensorflow:internal", +]) + +licenses(["notice"]) # Apache 2.0 + +exports_files([ + "LICENSE", +]) + +filegroup( + name = "all_files", + srcs = glob( + [ + "**/*", + ], + ), + visibility = ["//tensorflow:__subpackages__"], +) diff --git a/tensorflow/tensorboard/lib/js/BUILD b/tensorflow/tensorboard/lib/js/BUILD new file mode 100644 index 00000000000..66b5d60db06 --- /dev/null +++ b/tensorflow/tensorboard/lib/js/BUILD @@ -0,0 +1,12 @@ +# Description: +# BUILD rules for the frontend libraries in TensorBoard. + +package(default_visibility = [ + "//tensorflow:internal", +]) + +licenses(["notice"]) # Apache 2.0 + +exports_files([ + "LICENSE", +]) diff --git a/tensorflow/tensorflow.bzl b/tensorflow/tensorflow.bzl index f869a03607b..0562eecb04e 100644 --- a/tensorflow/tensorflow.bzl +++ b/tensorflow/tensorflow.bzl @@ -451,6 +451,12 @@ def cc_header_only_library(name, deps=[], **kwargs): hdrs=[":" + name + "_gather"], **kwargs) +def tf_custom_op_library_additional_deps(): + return [ + "//google/protobuf", + "//third_party/eigen3", + "//tensorflow/core:framework_headers_lib", + ] # Helper to build a dynamic library (.so) from the sources containing # implementations of custom ops and kernels. @@ -459,10 +465,7 @@ def tf_custom_op_library(name, srcs=[], gpu_srcs=[], deps=[]): "//tensorflow/core:stream_executor_headers_lib", "//third_party/gpus/cuda:cudart_static", ] - deps = deps + [ - "//third_party/eigen3", - "//tensorflow/core:framework_headers_lib", - ] + deps = deps + tf_custom_op_library_additional_deps() if gpu_srcs: basename = name.split(".")[0] cuda_copts = ["-x", "cuda", "-DGOOGLE_CUDA=1", diff --git a/tensorflow/tools/docker/notebooks/BUILD b/tensorflow/tools/docker/notebooks/BUILD new file mode 100644 index 00000000000..89f473df4bf --- /dev/null +++ b/tensorflow/tools/docker/notebooks/BUILD @@ -0,0 +1,17 @@ +package(default_visibility = ["//visibility:private"]) + +licenses(["notice"]) # Apache 2.0 + +exports_files(["LICENSE"]) + +filegroup( + name = "all_files", + srcs = glob( + ["**/*"], + exclude = [ + "**/METADATA", + "**/OWNERS", + ], + ), + visibility = ["//tensorflow:__subpackages__"], +) diff --git a/tensorflow/user_ops/BUILD b/tensorflow/user_ops/BUILD index 7b6c4276b0b..e2e8b00781b 100644 --- a/tensorflow/user_ops/BUILD +++ b/tensorflow/user_ops/BUILD @@ -23,7 +23,6 @@ load("//tensorflow:tensorflow.bzl", "tf_custom_op_library") tf_custom_op_library( name = "ackermann_op.so", srcs = ["ackermann_op.cc"], - deps = ["//google/protobuf"], ) py_tests(