diff options
author | Gunhan Gulsoy <gunan@google.com> | 2018-09-25 17:25:56 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-09-25 17:29:49 -0700 |
commit | f97610daf89572e52912ddc5bf87576cc9e82f66 (patch) | |
tree | 87a2478419f85b19bf84c096c2aaf6e192f59d0d | |
parent | 05d103bf25110157c34b9ea6420061a23aa6d4ec (diff) |
Fix dynamic kernels dependencies for python build and test rules.
Bazel does not allow python rules to directly depend on c++ rules.
So I have to separately manage static dependencies, unfortunately avoiding
"kernels" option for now.
PiperOrigin-RevId: 214532631
-rw-r--r-- | tensorflow/core/BUILD | 14 | ||||
-rw-r--r-- | tensorflow/tensorflow.bzl | 2 |
2 files changed, 13 insertions, 3 deletions
diff --git a/tensorflow/core/BUILD b/tensorflow/core/BUILD index 59b7dd04e9..bc0bfb793c 100644 --- a/tensorflow/core/BUILD +++ b/tensorflow/core/BUILD @@ -144,6 +144,7 @@ load( ) load( "//tensorflow/core:platform/default/build_config_root.bzl", + "if_dynamic_kernels", "if_static", "tf_cuda_tests_tags", ) @@ -1292,8 +1293,8 @@ cc_library( # This includes implementations of all kernels built into TensorFlow. cc_library( - name = "all_kernels", - visibility = ["//visibility:public"], + name = "all_kernels_statically_linked", + visibility = ["//visibility:private"], deps = [ "//tensorflow/core/kernels:array", "//tensorflow/core/kernels:audio", @@ -1372,6 +1373,15 @@ cc_library( ]), ) +cc_library( + name = "all_kernels", + visibility = ["//visibility:public"], + deps = if_dynamic_kernels( + [], + otherwise = [":all_kernels_statically_linked"], + ), +) + tf_cuda_library( name = "tensorflow_opensource", copts = tf_copts(), diff --git a/tensorflow/tensorflow.bzl b/tensorflow/tensorflow.bzl index 689679c838..7ddaf7806e 100644 --- a/tensorflow/tensorflow.bzl +++ b/tensorflow/tensorflow.bzl @@ -1677,7 +1677,7 @@ def py_test(deps = [], data = [], kernels = [], **kwargs): deps = select({ "//conditions:default": deps, clean_dep("//tensorflow:no_tensorflow_py_deps"): [], - }) + tf_binary_dynamic_kernel_deps(kernels), + }), data = data + select({ "//conditions:default": [], clean_dep("//tensorflow:no_tensorflow_py_deps"): ["//tensorflow/tools/pip_package:win_pip_package_marker"], |