1
+ # buildifier: disable=same-origin-load
2
+ load ("//tensorflow_model_optimization:tensorflow_model_optimization.bzl" , "py_strict_library" )
3
+
4
+ # buildifier: disable=same-origin-load
5
+ load ("//tensorflow_model_optimization:tensorflow_model_optimization.bzl" , "py_strict_test" )
6
+
1
7
package (default_visibility = [
2
8
"//tensorflow_model_optimization:__subpackages__" ,
3
9
"//third_party/tensorflow:__subpackages__" ,
4
10
])
5
11
6
12
licenses (["notice" ]) # Apache 2.0
7
13
8
- py_library (
14
+ py_strict_library (
9
15
name = "keras" ,
10
16
srcs = [
11
17
"__init__.py" ,
12
18
],
13
19
srcs_version = "PY3" ,
14
20
deps = [
15
- ":quantize" ,
21
+ ":quantize" , # build-cleaner: keep
16
22
# APIs are not exposed, but still needed for internal imports.
17
- "//tensorflow_model_optimization/python/core/quantization/keras/graph_transformations" ,
18
- "//tensorflow_model_optimization/python/core/quantization/keras/layers" ,
19
- "//tensorflow_model_optimization/python/core/quantization/keras/default_8bit" ,
20
- "//tensorflow_model_optimization/python/core/quantization/keras/collaborative_optimizations" ,
23
+ "//tensorflow_model_optimization/python/core/quantization/keras/graph_transformations" , # buildcleaner: keep
24
+ "//tensorflow_model_optimization/python/core/quantization/keras/layers" , # buildcleaner: keep
25
+ "//tensorflow_model_optimization/python/core/quantization/keras/default_8bit" , # buildcleaner: keep
26
+ "//tensorflow_model_optimization/python/core/quantization/keras/collaborative_optimizations" , # buildcleaner: keep
21
27
],
22
28
)
23
29
24
- py_library (
30
+ py_strict_library (
25
31
name = "quant_ops" ,
26
32
srcs = ["quant_ops.py" ],
27
33
srcs_version = "PY3" ,
@@ -32,19 +38,21 @@ py_library(
32
38
],
33
39
)
34
40
35
- py_test (
41
+ py_strict_test (
36
42
name = "quant_ops_test" ,
37
43
size = "small" ,
38
44
srcs = ["quant_ops_test.py" ],
39
45
python_version = "PY3" ,
40
46
deps = [
41
47
":quant_ops" ,
48
+ # absl/testing:parameterized dep1,
42
49
# tensorflow dep1,
50
+ # python/keras tensorflow dep2,
43
51
"//tensorflow_model_optimization/python/core/keras:compat" ,
44
52
],
45
53
)
46
54
47
- py_library (
55
+ py_strict_library (
48
56
name = "quantizers" ,
49
57
srcs = [
50
58
"quantizers.py" ,
@@ -58,7 +66,7 @@ py_library(
58
66
],
59
67
)
60
68
61
- py_test (
69
+ py_strict_test (
62
70
name = "quantizers_test" ,
63
71
srcs = [
64
72
"quantizers_test.py" ,
@@ -70,11 +78,12 @@ py_test(
70
78
# absl/testing:parameterized dep1,
71
79
# numpy dep1,
72
80
# tensorflow dep1,
73
- "//tensorflow_model_optimization/python/core/keras:test_utils" ,
81
+ # python/keras tensorflow dep2,
82
+ "//tensorflow_model_optimization/python/core/keras:compat" ,
74
83
],
75
84
)
76
85
77
- py_library (
86
+ py_strict_library (
78
87
name = "quantize_config" ,
79
88
srcs = [
80
89
"quantize_config.py" ,
@@ -83,11 +92,10 @@ py_library(
83
92
visibility = ["//visibility:public" ],
84
93
deps = [
85
94
# six dep1,
86
- # tensorflow dep1,
87
95
],
88
96
)
89
97
90
- py_library (
98
+ py_strict_library (
91
99
name = "quantize_registry" ,
92
100
srcs = [
93
101
"quantize_registry.py" ,
@@ -96,32 +104,29 @@ py_library(
96
104
visibility = ["//visibility:public" ],
97
105
deps = [
98
106
# six dep1,
99
- # tensorflow dep1,
100
107
],
101
108
)
102
109
103
- py_library (
110
+ py_strict_library (
104
111
name = "quantize_layout_transform" ,
105
112
srcs = [
106
113
"quantize_layout_transform.py" ,
107
114
],
108
115
srcs_version = "PY3" ,
109
116
visibility = ["//visibility:public" ],
110
117
deps = [
111
- # tensorflow dep1,
112
- # python/keras tensorflow dep2,
118
+ # six dep1,
113
119
],
114
120
)
115
121
116
- py_library (
122
+ py_strict_library (
117
123
name = "quantize_annotate" ,
118
124
srcs = [
119
125
"quantize_annotate.py" ,
120
126
],
121
127
srcs_version = "PY3" ,
122
128
visibility = ["//visibility:public" ],
123
129
deps = [
124
- ":quantize_config" ,
125
130
# tensorflow dep1,
126
131
],
127
132
)
@@ -141,21 +146,20 @@ py_test(
141
146
],
142
147
)
143
148
144
- py_library (
149
+ py_strict_library (
145
150
name = "quantize_aware_activation" ,
146
151
srcs = [
147
152
"quantize_aware_activation.py" ,
148
153
],
149
154
srcs_version = "PY3" ,
150
155
visibility = ["//visibility:public" ],
151
156
deps = [
152
- ":quant_ops" ,
153
157
# tensorflow dep1,
154
158
"//tensorflow_model_optimization/python/core/keras:utils" ,
155
159
],
156
160
)
157
161
158
- py_test (
162
+ py_strict_test (
159
163
name = "quantize_aware_activation_test" ,
160
164
srcs = [
161
165
"quantize_aware_activation_test.py" ,
@@ -165,12 +169,14 @@ py_test(
165
169
deps = [
166
170
":quantize_aware_activation" ,
167
171
":quantizers" ,
172
+ # absl/testing:parameterized dep1,
168
173
# numpy dep1,
169
174
# tensorflow dep1,
175
+ # python/keras tensorflow dep2,
170
176
],
171
177
)
172
178
173
- py_library (
179
+ py_strict_library (
174
180
name = "quantize_layer" ,
175
181
srcs = [
176
182
"quantize_layer.py" ,
@@ -184,7 +190,7 @@ py_library(
184
190
],
185
191
)
186
192
187
- py_test (
193
+ py_strict_test (
188
194
name = "quantize_layer_test" ,
189
195
srcs = [
190
196
"quantize_layer_test.py" ,
@@ -193,13 +199,13 @@ py_test(
193
199
visibility = ["//visibility:public" ],
194
200
deps = [
195
201
":quantize_layer" ,
196
- # absl/testing:parameterized dep1 ,
202
+ ":quantizers" ,
197
203
# numpy dep1,
198
204
# tensorflow dep1,
199
205
],
200
206
)
201
207
202
- py_library (
208
+ py_strict_library (
203
209
name = "quantize_wrapper" ,
204
210
srcs = [
205
211
"quantize_wrapper.py" ,
@@ -208,15 +214,14 @@ py_library(
208
214
visibility = ["//visibility:public" ],
209
215
deps = [
210
216
":quantize_aware_activation" ,
211
- ":quantize_config" ,
212
- ":quantizers" ,
213
217
# tensorflow dep1,
218
+ # python/util tensorflow dep2,
214
219
"//tensorflow_model_optimization/python/core/keras:metrics" ,
215
220
"//tensorflow_model_optimization/python/core/keras:utils" ,
216
221
],
217
222
)
218
223
219
- py_test (
224
+ py_strict_test (
220
225
name = "quantize_wrapper_test" ,
221
226
srcs = [
222
227
"quantize_wrapper_test.py" ,
@@ -233,7 +238,7 @@ py_test(
233
238
],
234
239
)
235
240
236
- py_library (
241
+ py_strict_library (
237
242
name = "quantize" ,
238
243
srcs = [
239
244
"quantize.py" ,
@@ -242,8 +247,11 @@ py_library(
242
247
visibility = ["//visibility:public" ],
243
248
deps = [
244
249
":quantize_annotate" ,
250
+ ":quantize_aware_activation" ,
251
+ ":quantize_config" ,
245
252
":quantize_layer" ,
246
253
":quantize_wrapper" ,
254
+ ":quantizers" ,
247
255
# tensorflow dep1,
248
256
"//tensorflow_model_optimization/python/core/keras:metrics" ,
249
257
"//tensorflow_model_optimization/python/core/quantization/keras/default_8bit:default_8bit_quantize_registry" ,
@@ -252,39 +260,43 @@ py_library(
252
260
],
253
261
)
254
262
255
- py_test (
263
+ py_strict_test (
256
264
name = "quantize_test" ,
257
265
srcs = ["quantize_test.py" ],
258
266
python_version = "PY3" ,
259
267
visibility = ["//visibility:public" ],
260
268
deps = [
261
269
":quantize" ,
270
+ ":quantize_annotate" ,
271
+ ":quantize_config" ,
262
272
":quantize_layer" ,
263
273
":quantize_wrapper" ,
264
- # absl/testing:parameterized dep1,
265
274
# numpy dep1,
266
275
# tensorflow dep1,
267
276
"//tensorflow_model_optimization/python/core/keras:test_utils" ,
268
277
"//tensorflow_model_optimization/python/core/quantization/keras/default_8bit:default_8bit_quantize_registry" ,
269
278
],
270
279
)
271
280
272
- py_test (
281
+ py_strict_test (
273
282
name = "quantize_integration_test" ,
274
283
srcs = ["quantize_integration_test.py" ],
275
284
python_version = "PY3" ,
276
285
deps = [
277
286
":quantize" ,
287
+ ":quantize_config" ,
288
+ ":quantizers" ,
278
289
":utils" ,
279
290
# absl/testing:parameterized dep1,
280
291
# numpy dep1,
281
292
# tensorflow dep1,
293
+ # python/keras tensorflow dep2,
282
294
"//tensorflow_model_optimization/python/core/keras:compat" ,
283
295
"//tensorflow_model_optimization/python/core/keras:test_utils" ,
284
296
],
285
297
)
286
298
287
- py_test (
299
+ py_strict_test (
288
300
name = "quantize_models_test" ,
289
301
size = "large" ,
290
302
srcs = ["quantize_models_test.py" ],
@@ -297,12 +309,11 @@ py_test(
297
309
# absl/testing:parameterized dep1,
298
310
# numpy dep1,
299
311
# tensorflow dep1,
300
- "//tensorflow_model_optimization/python/core/keras:compat" ,
301
- "//tensorflow_model_optimization/python/core/keras:test_utils" ,
312
+ # python/keras tensorflow dep2,
302
313
],
303
314
)
304
315
305
- py_test (
316
+ py_strict_test (
306
317
name = "quantize_functional_test" ,
307
318
size = "large" ,
308
319
srcs = ["quantize_functional_test.py" ],
@@ -315,13 +326,13 @@ py_test(
315
326
# absl/testing:parameterized dep1,
316
327
# numpy dep1,
317
328
# tensorflow dep1,
329
+ # python/keras tensorflow dep2,
318
330
"//tensorflow_model_optimization/python/core/keras:compat" ,
319
- "//tensorflow_model_optimization/python/core/keras:test_utils" ,
320
331
"//tensorflow_model_optimization/python/core/keras/testing:test_utils_mnist" ,
321
332
],
322
333
)
323
334
324
- py_library (
335
+ py_strict_library (
325
336
name = "utils" ,
326
337
srcs = [
327
338
"utils.py" ,
@@ -330,14 +341,18 @@ py_library(
330
341
visibility = ["//visibility:public" ],
331
342
deps = [
332
343
# tensorflow dep1,
344
+ "//tensorflow_model_optimization/python/core/keras:compat" ,
333
345
],
334
346
)
335
347
336
- py_library (
348
+ py_strict_library (
337
349
name = "quantize_scheme" ,
338
350
srcs = [
339
351
"quantize_scheme.py" ,
340
352
],
341
353
srcs_version = "PY3" ,
342
354
visibility = ["//visibility:public" ],
355
+ deps = [
356
+ # six dep1,
357
+ ],
343
358
)
0 commit comments