diff --git a/tensorflow/core/BUILD b/tensorflow/core/BUILD index 59b7dd04e9d..bc0bfb793ca 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 689679c8385..7ddaf7806ea 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"],