1# Description: 2# Contains the Keras Utilities (internal TensorFlow version). 3 4package( 5 # TODO(scottzhu): Remove non-keras deps from TF. 6 default_visibility = [ 7 "//tensorflow/python/feature_column:__pkg__", 8 "//tensorflow/python/keras:__subpackages__", 9 "//tensorflow/tools/pip_package:__pkg__", 10 ], 11 licenses = ["notice"], 12) 13 14filegroup( 15 name = "all_py_srcs", 16 srcs = glob(["*.py"]), 17 visibility = ["//tensorflow/python/keras/google/private_tf_api_test:__pkg__"], 18) 19 20py_library( 21 name = "utils", 22 srcs = [ 23 "__init__.py", 24 ], 25 srcs_version = "PY3", 26 deps = [ 27 ":all_utils", 28 ], 29) 30 31py_library( 32 name = "all_utils", 33 srcs = [ 34 "all_utils.py", 35 ], 36 srcs_version = "PY3", 37 deps = [ 38 ":control_flow_util", 39 ":engine_utils", 40 ":generic_utils", 41 ":layer_utils", 42 ":np_utils", 43 ":vis_utils", 44 ], 45) 46 47py_library( 48 name = "control_flow_util", 49 srcs = ["control_flow_util.py"], 50 srcs_version = "PY3", 51 deps = [], 52) 53 54py_library( 55 name = "data_utils", 56 srcs = ["data_utils.py"], 57 srcs_version = "PY3", 58 deps = [ 59 ":generic_utils", 60 ":io_utils", 61 ":tf_inspect", 62 ], 63) 64 65py_library( 66 name = "engine_utils", 67 srcs = [ 68 "conv_utils.py", 69 "losses_utils.py", 70 ], 71 srcs_version = "PY3", 72 deps = [ 73 ":data_utils", 74 ":io_utils", 75 "//tensorflow/python/keras:backend", 76 ], 77) 78 79py_library( 80 name = "io_utils", 81 srcs = ["io_utils.py"], 82 srcs_version = "PY3", 83) 84 85py_library( 86 name = "tf_utils", 87 srcs = ["tf_utils.py"], 88 srcs_version = "PY3", 89 deps = [ 90 ":object_identity", 91 "//tensorflow/python:composite_tensor", 92 "//tensorflow/python:control_flow_ops", 93 "//tensorflow/python:framework_ops", 94 "//tensorflow/python:smart_cond", 95 "//tensorflow/python:tensor_shape", 96 "//tensorflow/python:tensor_util", 97 "//tensorflow/python:util", 98 "//tensorflow/python:variables", 99 "//tensorflow/python/distribute/coordinator:cluster_coordinator", 100 "//tensorflow/python/eager:context", 101 ], 102) 103 104py_library( 105 name = "generic_utils", 106 srcs = [ 107 "generic_utils.py", 108 ], 109 srcs_version = "PY3", 110 deps = [ 111 ":tf_contextlib", 112 ":tf_inspect", 113 "//tensorflow/python:util", 114 "//third_party/py/numpy", 115 ], 116) 117 118py_library( 119 name = "mode_keys", 120 srcs = [ 121 "mode_keys.py", 122 ], 123 srcs_version = "PY3", 124 deps = [ 125 "//tensorflow/python/saved_model/model_utils:mode_keys", 126 ], 127) 128 129py_library( 130 name = "layer_utils", 131 srcs = [ 132 "kernelized_utils.py", 133 "layer_utils.py", 134 ], 135 srcs_version = "PY3", 136 deps = [ 137 ":engine_utils", 138 "//tensorflow/python:util", 139 "//tensorflow/python/keras:backend", 140 "//third_party/py/numpy", 141 ], 142) 143 144py_library( 145 name = "metrics_utils", 146 srcs = [ 147 "metrics_utils.py", 148 ], 149 srcs_version = "PY3", 150 deps = [ 151 ":generic_utils", 152 ":tf_utils", 153 "//tensorflow/python:array_ops", 154 "//tensorflow/python:check_ops", 155 "//tensorflow/python:control_flow_ops", 156 "//tensorflow/python:distribute", 157 "//tensorflow/python:dtypes", 158 "//tensorflow/python:framework", 159 "//tensorflow/python:math_ops", 160 "//tensorflow/python:nn_ops", 161 "//tensorflow/python:util", 162 "//tensorflow/python:weights_broadcast_ops", 163 "//tensorflow/python/ops/losses", 164 "//tensorflow/python/ops/ragged:ragged_tensor", 165 "//tensorflow/python/ops/ragged:ragged_util", 166 "//tensorflow/python/tpu:tpu_lib", 167 ], 168) 169 170py_library( 171 name = "version_utils", 172 srcs = [ 173 "version_utils.py", 174 ], 175 srcs_version = "PY3", 176 deps = [ 177 "//tensorflow/python:framework_ops", 178 "//tensorflow/python:util", 179 ], 180) 181 182py_library( 183 name = "np_utils", 184 srcs = [ 185 "np_utils.py", 186 ], 187 srcs_version = "PY3", 188 deps = [ 189 "//tensorflow/python:util", 190 "//third_party/py/numpy", 191 ], 192) 193 194py_library( 195 name = "object_identity", 196 srcs = ["object_identity.py"], 197 srcs_version = "PY3", 198 deps = [], 199) 200 201py_library( 202 name = "tf_contextlib", 203 srcs = ["tf_contextlib.py"], 204 srcs_version = "PY3", 205 deps = [ 206 "//tensorflow/python:util", 207 ], 208) 209 210py_library( 211 name = "tf_inspect", 212 srcs = ["tf_inspect.py"], 213 srcs_version = "PY3", 214 deps = [ 215 "//tensorflow/python:util", 216 ], 217) 218 219py_library( 220 name = "vis_utils", 221 srcs = [ 222 "vis_utils.py", 223 ], 224 srcs_version = "PY3", 225 deps = [ 226 "//tensorflow/python:util", 227 ], 228) 229 230py_library( 231 name = "dataset_creator", 232 srcs = [ 233 "dataset_creator.py", 234 ], 235 srcs_version = "PY3", 236 deps = [ 237 "//tensorflow/python:util", 238 "//tensorflow/python/util:tf_export", 239 ], 240) 241