1package(default_visibility = ["//tensorflow:__subpackages__"]) 2 3licenses(["notice"]) # Apache 2.0 4 5exports_files(["LICENSE"]) 6 7load("//tensorflow:tensorflow.bzl", "py_test") 8 9py_library( 10 name = "common", 11 srcs = ["python/common.py"], 12 srcs_version = "PY2AND3", 13 deps = [], 14) 15 16py_test( 17 name = "common_test", 18 size = "small", 19 srcs = ["python/common_test.py"], 20 srcs_version = "PY2AND3", 21 deps = [ 22 ":common", 23 "//tensorflow/contrib/layers:layers_py", 24 "//tensorflow/python:array_ops", 25 "//tensorflow/python:framework_ops", 26 "//tensorflow/python:framework_test_lib", 27 "//tensorflow/python:init_ops", 28 "//tensorflow/python:math_ops", 29 "//tensorflow/python:nn_ops", 30 "//tensorflow/python:platform_test", 31 "//tensorflow/python:session", 32 "//tensorflow/python:variable_scope", 33 ], 34) 35 36py_library( 37 name = "graph_matcher", 38 srcs = [ 39 "python/graph_matcher.py", 40 ], 41 srcs_version = "PY2AND3", 42 deps = [], 43) 44 45py_test( 46 name = "graph_matcher_test", 47 size = "small", 48 srcs = ["python/graph_matcher_test.py"], 49 srcs_version = "PY2AND3", 50 deps = [ 51 ":graph_matcher", 52 "//tensorflow/contrib/framework:framework_py", 53 "//tensorflow/contrib/layers:layers_py", 54 "//tensorflow/python:array_ops", 55 "//tensorflow/python:dtypes", 56 "//tensorflow/python:framework_ops", 57 "//tensorflow/python:framework_test_lib", 58 "//tensorflow/python:init_ops", 59 "//tensorflow/python:math_ops", 60 "//tensorflow/python:nn_ops", 61 "//tensorflow/python:platform_test", 62 ], 63) 64 65py_library( 66 name = "input_to_ops", 67 srcs = ["python/input_to_ops.py"], 68 srcs_version = "PY2AND3", 69 deps = [ 70 ":common", 71 ], 72) 73 74py_test( 75 name = "input_to_ops_test", 76 size = "small", 77 srcs = ["python/input_to_ops_test.py"], 78 srcs_version = "PY2AND3", 79 deps = [ 80 ":input_to_ops", 81 "//tensorflow/python:array_ops", 82 "//tensorflow/python:framework_ops", 83 "//tensorflow/python:framework_test_lib", 84 "//tensorflow/python:nn_ops", 85 "//tensorflow/python:platform_test", 86 ], 87) 88 89py_library( 90 name = "fold_batch_norms", 91 srcs = ["python/fold_batch_norms.py"], 92 srcs_version = "PY2AND3", 93 deps = [ 94 ":common", 95 ":graph_matcher", 96 ":input_to_ops", 97 "//tensorflow/core:protos_all_py", 98 "//tensorflow/python:array_ops", 99 "//tensorflow/python:dtypes", 100 "//tensorflow/python:framework_ops", 101 "//tensorflow/python:layers", 102 "//tensorflow/python:math_ops", 103 "//tensorflow/python:nn", 104 "//tensorflow/python:nn_ops", 105 "//tensorflow/python:ops", 106 "//tensorflow/python:training", 107 "//tensorflow/python:util", 108 "//tensorflow/python:variables", 109 ], 110) 111 112py_test( 113 name = "fold_batch_norms_test", 114 srcs = ["python/fold_batch_norms_test.py"], 115 srcs_version = "PY2AND3", 116 deps = [ 117 ":fold_batch_norms", 118 "//tensorflow/contrib/layers:layers_py", 119 "//tensorflow/python:array_ops", 120 "//tensorflow/python:dtypes", 121 "//tensorflow/python:framework_ops", 122 "//tensorflow/python:framework_test_lib", 123 "//tensorflow/python:gradients", 124 "//tensorflow/python:init_ops", 125 "//tensorflow/python:math_ops", 126 "//tensorflow/python:nn_ops", 127 "//tensorflow/python:platform_test", 128 "//tensorflow/python:random_ops", 129 "//tensorflow/python:random_seed", 130 "//tensorflow/python:session", 131 "//tensorflow/python:training", 132 "//tensorflow/python:variables", 133 ], 134) 135 136py_library( 137 name = "quant_ops", 138 srcs = ["python/quant_ops.py"], 139 srcs_version = "PY2AND3", 140 deps = [ 141 "//tensorflow/python:array_ops", 142 "//tensorflow/python:framework_ops", 143 "//tensorflow/python:init_ops", 144 "//tensorflow/python:math_ops", 145 "//tensorflow/python:state_ops", 146 "//tensorflow/python:training", 147 "//tensorflow/python:variable_scope", 148 ], 149) 150 151py_test( 152 name = "quant_ops_test", 153 size = "small", 154 srcs = ["python/quant_ops_test.py"], 155 srcs_version = "PY2AND3", 156 deps = [ 157 ":quant_ops", 158 "//tensorflow/python:array_ops", 159 "//tensorflow/python:dtypes", 160 "//tensorflow/python:framework_ops", 161 "//tensorflow/python:partitioned_variables", 162 "//tensorflow/python:platform_test", 163 "//tensorflow/python:session", 164 "//tensorflow/python:variable_scope", 165 "//tensorflow/python:variables", 166 ], 167) 168 169py_library( 170 name = "quantize", 171 srcs = ["python/quantize.py"], 172 srcs_version = "PY2AND3", 173 deps = [ 174 ":graph_matcher", 175 ":input_to_ops", 176 ":quant_ops", 177 "//tensorflow/python:control_flow_ops", 178 "//tensorflow/python:framework_ops", 179 "//tensorflow/python:math_ops", 180 "//tensorflow/python:training", 181 ], 182) 183 184py_test( 185 name = "quantize_test", 186 size = "small", 187 srcs = ["python/quantize_test.py"], 188 srcs_version = "PY2AND3", 189 deps = [ 190 ":quantize", 191 "//tensorflow/contrib/layers:layers_py", 192 "//tensorflow/python:array_ops", 193 "//tensorflow/python:control_flow_ops", 194 "//tensorflow/python:framework_ops", 195 "//tensorflow/python:framework_test_lib", 196 "//tensorflow/python:init_ops", 197 "//tensorflow/python:math_ops", 198 "//tensorflow/python:nn_ops", 199 "//tensorflow/python:platform_test", 200 ], 201) 202 203py_test( 204 name = "quantize_parameterized_test", 205 size = "medium", 206 srcs = ["python/quantize_parameterized_test.py"], 207 shard_count = 4, 208 srcs_version = "PY2AND3", 209 # TODO(b/118839526): Re-enable msan test. 210 tags = [ 211 "nomsan", 212 ], 213 deps = [ 214 ":fold_batch_norms", 215 ":quantize", 216 "//tensorflow/contrib/layers:layers_py", 217 "//tensorflow/python:array_ops", 218 "//tensorflow/python:control_flow_ops", 219 "//tensorflow/python:framework_ops", 220 "//tensorflow/python:framework_test_lib", 221 "//tensorflow/python:init_ops", 222 "//tensorflow/python:math_ops", 223 "//tensorflow/python:nn_ops", 224 "//tensorflow/python:platform_test", 225 ], 226) 227 228py_library( 229 name = "quantize_graph", 230 srcs = [ 231 "__init__.py", 232 "python/quantize_graph.py", 233 ], 234 srcs_version = "PY2AND3", 235 deps = [ 236 ":fold_batch_norms", 237 ":quantize", 238 "//tensorflow/python:util", 239 ], 240) 241 242py_test( 243 name = "quantize_graph_test", 244 size = "small", 245 srcs = ["python/quantize_graph_test.py"], 246 srcs_version = "PY2AND3", 247 deps = [ 248 ":quantize_graph", 249 "//tensorflow/contrib/layers:layers_py", 250 "//tensorflow/python:array_ops", 251 "//tensorflow/python:framework_ops", 252 "//tensorflow/python:framework_test_lib", 253 "//tensorflow/python:init_ops", 254 "//tensorflow/python:math_ops", 255 "//tensorflow/python:nn_ops", 256 "//tensorflow/python:platform_test", 257 "//tensorflow/python:training", 258 ], 259) 260