From 8a4c72a084583a442451ab1234971a87da30f998 Mon Sep 17 00:00:00 2001 From: Scott Zhu Date: Sun, 7 Jun 2020 17:49:32 -0700 Subject: [PATCH] Cleanup the build deps for base_layer. The base_layer was missing a bunch of deps, which could cause the tests that using it to fail if they didn't import needed deps. PiperOrigin-RevId: 315193992 Change-Id: I7db0083886ee27e742c7280601f11b275190df3b --- tensorflow/python/keras/engine/BUILD | 57 ++++++++++++++++++++++++---- 1 file changed, 49 insertions(+), 8 deletions(-) diff --git a/tensorflow/python/keras/engine/BUILD b/tensorflow/python/keras/engine/BUILD index 4e9ed792548..c64e38122e9 100644 --- a/tensorflow/python/keras/engine/BUILD +++ b/tensorflow/python/keras/engine/BUILD @@ -23,7 +23,6 @@ py_library( "compile_utils.py", "functional.py", "input_layer.py", - "node.py", "partial_batch_padding_handler.py", "saving.py", "sequential.py", @@ -42,6 +41,7 @@ py_library( ":data_adapter", ":input_spec", ":keras_tensor", + ":node", "//tensorflow/python:composite_tensor_utils", "//tensorflow/python:py_checkpoint_reader", "//tensorflow/python/data", @@ -111,31 +111,56 @@ py_library( srcs_version = "PY2AND3", deps = [ ":base_layer_utils", - "//tensorflow/core:protos_all_py", + ":input_spec", + ":node", + "//third_party/py/numpy", + "@six_archive//:six", + "//tensorflow/python:array_ops", + "//tensorflow/python:auto_control_deps", "//tensorflow/python:constant_op", + "//tensorflow/python:dtypes", + "//tensorflow/python:errors", + "//tensorflow/python:framework_ops", + "//tensorflow/python:func_graph", + "//tensorflow/python:math_ops", + "//tensorflow/python:platform", + "//tensorflow/python:resource_variable_ops", + "//tensorflow/python:sparse_tensor", + "//tensorflow/python:tensor_spec", + "//tensorflow/python:tensor_util", "//tensorflow/python:tf2", - "//tensorflow/python/data", - "//tensorflow/python/distribute:distribute_coordinator", + "//tensorflow/python:tf_export", + "//tensorflow/python:util", + "//tensorflow/python:variables", + "//tensorflow/python/autograph/core", + "//tensorflow/python/autograph/impl", "//tensorflow/python/distribute:distribute_lib", - "//tensorflow/python/distribute:input_lib", - "//tensorflow/python/distribute:reduce_util", "//tensorflow/python/distribute:sharded_variable", + "//tensorflow/python/eager:context", + "//tensorflow/python/eager:execute", + "//tensorflow/python/eager:function", "//tensorflow/python/eager:monitoring", "//tensorflow/python/keras:backend", "//tensorflow/python/keras:constraints", + "//tensorflow/python/keras:initializers", + # TODO(keras-team): Fix the cyclar deps between layer and metrics. + # "//tensorflow/python/keras:metrics", "//tensorflow/python/keras:regularizers", - "//tensorflow/python/keras/distribute", "//tensorflow/python/keras/mixed_precision/experimental:autocast_variable", "//tensorflow/python/keras/mixed_precision/experimental:loss_scale_optimizer", "//tensorflow/python/keras/mixed_precision/experimental:policy", + "//tensorflow/python/keras/saving", "//tensorflow/python/keras/utils:generic_utils", "//tensorflow/python/keras/utils:layer_utils", "//tensorflow/python/keras/utils:tf_utils", "//tensorflow/python/keras/utils:version_utils", "//tensorflow/python/module", + "//tensorflow/python/ops/ragged:ragged_tensor", + "//tensorflow/python/training/tracking", + "//tensorflow/python/training/tracking:base", "//tensorflow/python/training/tracking:data_structures", + "//tensorflow/python/training/tracking:layer_utils", "//tensorflow/tools/docs:doc_controls", - "@six_archive//:six", ], ) @@ -194,6 +219,22 @@ py_library( ], ) +py_library( + name = "node", + srcs = ["node.py"], + srcs_version = "PY2AND3", + deps = [ + ":base_layer_utils", + "//tensorflow/python:framework_ops", + "//tensorflow/python:platform", + "//tensorflow/python:tensor_util", + "//tensorflow/python:util", + "//tensorflow/python/keras:backend", + "//tensorflow/python/keras/utils:tf_utils", + "//third_party/py/numpy", + ], +) + tf_py_test( name = "base_layer_utils_test", srcs = ["base_layer_utils_test.py"],