Skip to content

Commit e06ec19

Browse files
teijeongtensorflower-gardener
authored andcommitted
Fix dependencies for core/clustering, core/common, and core/sparsity
PiperOrigin-RevId: 370621468
1 parent 2068ab3 commit e06ec19

File tree

8 files changed

+130
-65
lines changed

8 files changed

+130
-65
lines changed
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
load("//tensorflow_model_optimization:tensorflow_model_optimization.bzl", "py_strict_library")
2+
13
package(default_visibility = ["//visibility:public"])
24

35
licenses(["notice"]) # Apache 2.0
46

5-
py_library(
7+
py_strict_library(
68
name = "clustering",
79
srcs = ["__init__.py"],
810
srcs_version = "PY3",
9-
deps = ["//tensorflow_model_optimization/python/core/clustering/keras"],
11+
deps = [
12+
"//tensorflow_model_optimization/python/core/clustering/keras", # buildcleaner: keep
13+
],
1014
)

tensorflow_model_optimization/python/core/clustering/keras/BUILD

Lines changed: 54 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
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+
17
package(default_visibility = [
28
"//tensorflow_model_optimization:__subpackages__",
39
])
410

511
licenses(["notice"])
612

7-
py_library(
13+
py_strict_library(
814
name = "keras",
915
srcs = [
1016
"__init__.py",
1117
],
1218
srcs_version = "PY3",
1319
deps = [
14-
":cluster",
15-
":clustering_callbacks",
16-
"//tensorflow_model_optimization/python/core/clustering/keras/experimental",
20+
":cluster", # buildcleaner: keep
21+
":clustering_callbacks", # buildcleaner: keep
22+
"//tensorflow_model_optimization/python/core/clustering/keras/experimental", # buildcleaner: keep
1723
],
1824
)
1925

@@ -23,14 +29,13 @@ py_library(
2329
srcs_version = "PY3",
2430
visibility = ["//visibility:public"],
2531
deps = [
26-
":cluster_config",
2732
":cluster_wrapper",
2833
":clustering_centroids",
29-
":clustering_registry",
34+
# tensorflow dep1,
3035
],
3136
)
3237

33-
py_library(
38+
py_strict_library(
3439
name = "cluster_config",
3540
srcs = ["cluster_config.py"],
3641
srcs_version = "PY3",
@@ -45,23 +50,30 @@ py_library(
4550
deps = [
4651
":clusterable_layer",
4752
":clustering_algorithm",
53+
# tensorflow dep1,
4854
],
4955
)
5056

51-
py_library(
57+
py_strict_library(
5258
name = "clusterable_layer",
5359
srcs = ["clusterable_layer.py"],
5460
srcs_version = "PY3",
5561
visibility = ["//visibility:public"],
62+
deps = [
63+
# six dep1,
64+
],
5665
)
5766

58-
py_library(
67+
py_strict_library(
5968
name = "clustering_centroids",
6069
srcs = ["clustering_centroids.py"],
6170
srcs_version = "PY3",
6271
visibility = ["//visibility:public"],
6372
deps = [
6473
":cluster_config",
74+
# six dep1,
75+
# tensorflow dep1,
76+
# python:clustering_ops tensorflow dep2,
6577
],
6678
)
6779

@@ -72,15 +84,20 @@ py_library(
7284
visibility = ["//visibility:public"],
7385
deps = [
7486
":cluster_config",
87+
":clusterable_layer",
88+
":clustering_centroids",
89+
":clustering_registry",
90+
# tensorflow dep1,
7591
],
7692
)
7793

78-
py_library(
94+
py_strict_library(
7995
name = "clustering_algorithm",
8096
srcs = ["clustering_algorithm.py"],
8197
srcs_version = "PY3",
8298
visibility = ["//visibility:public"],
8399
deps = [
100+
# six dep1,
84101
# tensorflow dep1,
85102
"//tensorflow_model_optimization/python/core/clustering/keras:cluster_config",
86103
],
@@ -105,6 +122,11 @@ py_test(
105122
visibility = ["//visibility:public"],
106123
deps = [
107124
":cluster",
125+
":cluster_config",
126+
":cluster_wrapper",
127+
":clusterable_layer",
128+
":clustering_registry",
129+
# absl/testing:parameterized dep1,
108130
# tensorflow dep1,
109131
"//tensorflow_model_optimization/python/core/clustering/keras/experimental:cluster",
110132
],
@@ -117,37 +139,40 @@ py_test(
117139
python_version = "PY3",
118140
visibility = ["//visibility:public"],
119141
deps = [
142+
":cluster_config",
120143
":clustering_centroids",
144+
# absl/testing:parameterized dep1,
121145
# tensorflow dep1,
122146
],
123147
)
124148

125-
py_test(
149+
py_strict_test(
126150
name = "cluster_wrapper_test",
127151
size = "medium",
128152
srcs = ["cluster_wrapper_test.py"],
129153
python_version = "PY3",
130154
visibility = ["//visibility:public"],
131155
deps = [
132156
":cluster",
157+
":cluster_config",
133158
":cluster_wrapper",
134159
":clusterable_layer",
135-
":clustering_centroids",
136-
":clustering_registry",
160+
# absl/testing:parameterized dep1,
137161
# tensorflow dep1,
138162
],
139163
)
140164

141-
py_test(
165+
py_strict_test(
142166
name = "clustering_registry_test",
143167
size = "medium",
144168
srcs = ["clustering_registry_test.py"],
145169
python_version = "PY3",
146170
visibility = ["//visibility:public"],
147171
deps = [
148-
":cluster_wrapper",
172+
":cluster_config",
149173
":clusterable_layer",
150174
":clustering_registry",
175+
# absl/testing:parameterized dep1,
151176
# tensorflow dep1,
152177
],
153178
)
@@ -160,42 +185,52 @@ py_test(
160185
visibility = ["//visibility:public"],
161186
deps = [
162187
":cluster",
188+
":cluster_config",
189+
# absl/testing:parameterized dep1,
190+
# numpy dep1,
163191
# tensorflow dep1,
164192
"//tensorflow_model_optimization/python/core/clustering/keras/experimental:cluster",
165-
"//tensorflow_model_optimization/python/core/keras:compat",
166193
],
167194
)
168195

169-
py_test(
196+
py_strict_test(
170197
name = "cluster_distributed_test",
171198
srcs = ["cluster_distributed_test.py"],
172199
python_version = "PY3",
173200
visibility = ["//visibility:public"],
174201
deps = [
175202
":cluster",
203+
":cluster_config",
204+
":cluster_wrapper",
205+
# absl/testing:parameterized dep1,
206+
# numpy dep1,
176207
# tensorflow dep1,
177208
"//tensorflow_model_optimization/python/core/keras:test_utils",
178209
],
179210
)
180211

181-
py_test(
212+
py_strict_test(
182213
name = "mnist_clusterable_layer_test",
183214
srcs = ["mnist_clusterable_layer_test.py"],
184215
python_version = "PY3",
185216
visibility = ["//visibility:public"],
186217
deps = [
187218
":cluster",
219+
":cluster_config",
220+
":clusterable_layer",
221+
":clustering_algorithm",
188222
# tensorflow dep1,
189223
],
190224
)
191225

192-
py_test(
226+
py_strict_test(
193227
name = "mnist_clustering_test",
194228
srcs = ["mnist_clustering_test.py"],
195229
python_version = "PY3",
196230
visibility = ["//visibility:public"],
197231
deps = [
198232
":cluster",
233+
":cluster_config",
199234
# tensorflow dep1,
200235
],
201236
)

tensorflow_model_optimization/python/core/clustering/keras/experimental/BUILD

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1+
load("//tensorflow_model_optimization:tensorflow_model_optimization.bzl", "py_strict_library")
2+
13
package(default_visibility = [
24
"//tensorflow_model_optimization:__subpackages__",
35
])
46

57
licenses(["notice"])
68

7-
py_library(
9+
py_strict_library(
810
name = "experimental",
911
srcs = [
1012
"__init__.py",
1113
],
1214
srcs_version = "PY3",
1315
deps = [
14-
":cluster",
16+
":cluster", # buildcleaner: keep
1517
],
1618
)
1719

18-
py_library(
20+
py_strict_library(
1921
name = "cluster",
2022
srcs = ["cluster.py"],
2123
srcs_version = "PY3",
Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
load("//tensorflow_model_optimization:tensorflow_model_optimization.bzl", "pytype_library")
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+
load("//tensorflow_model_optimization:tensorflow_model_optimization.bzl", "pytype_strict_library")
27

38
licenses(["notice"])
49

5-
pytype_library(
10+
pytype_strict_library(
611
name = "algorithm",
712
srcs = ["algorithm.py"],
813
srcs_version = "PY3",
@@ -15,7 +20,7 @@ pytype_library(
1520
],
1621
)
1722

18-
py_library(
23+
py_strict_library(
1924
name = "schedules",
2025
srcs = ["schedules.py"],
2126
srcs_version = "PY3ONLY",
@@ -24,16 +29,14 @@ py_library(
2429
],
2530
)
2631

27-
py_test(
32+
py_strict_test(
2833
name = "schedules_test",
2934
srcs = [
3035
"schedules_test.py",
3136
],
3237
python_version = "PY3",
3338
deps = [
3439
":schedules",
35-
# absl/testing:parameterized dep1,
36-
# numpy dep1,
3740
# tensorflow dep1,
3841
],
3942
)

0 commit comments

Comments
 (0)