File tree Expand file tree Collapse file tree 5 files changed +7
-10
lines changed
tensorflow_model_optimization/python/core
collaborative_optimizations/prune_preserve Expand file tree Collapse file tree 5 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ py_test(
132
132
],
133
133
)
134
134
135
- py_test (
135
+ py_strict_test (
136
136
name = "clustering_centroids_test" ,
137
137
size = "medium" ,
138
138
srcs = ["clustering_centroids_test.py" ],
Original file line number Diff line number Diff line change 16
16
17
17
from absl .testing import parameterized
18
18
import tensorflow as tf
19
- import tensorflow .keras .backend as K
20
19
21
20
from tensorflow_model_optimization .python .core .clustering .keras import cluster_config
22
21
from tensorflow_model_optimization .python .core .clustering .keras import clustering_centroids
23
22
24
- keras = tf .keras
23
+ K = tf .keras . backend
25
24
errors_impl = tf .errors
26
- layers = keras .layers
27
- test = tf .test
28
25
29
26
CentroidInitialization = cluster_config .CentroidInitialization
30
27
31
28
32
- class ClusteringCentroidsTest (test .TestCase , parameterized .TestCase ):
29
+ class ClusteringCentroidsTest (tf . test .TestCase , parameterized .TestCase ):
33
30
"""Unit tests for the clustering_centroids module."""
34
31
35
32
def setUp (self ):
@@ -221,4 +218,4 @@ def testKmeansPlusPlusClusterCentroidsWithSparsityPreservation(
221
218
222
219
223
220
if __name__ == "__main__" :
224
- test .main ()
221
+ tf . test .main ()
Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ py_strict_library(
131
131
],
132
132
)
133
133
134
- py_test (
134
+ py_strict_test (
135
135
name = "quantize_annotate_test" ,
136
136
srcs = [
137
137
"quantize_annotate_test.py" ,
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ py_test(
41
41
visibility = ["//visibility:private" ],
42
42
deps = [
43
43
":prune_preserve_quantize_registry" ,
44
+ # absl/testing:parameterized dep1,
44
45
# tensorflow dep1,
45
46
"//tensorflow_model_optimization/python/core/quantization/keras/default_8bit:default_8bit_quantize_registry" ,
46
47
"//tensorflow_model_optimization/python/core/sparsity/keras:prune_registry" ,
Original file line number Diff line number Diff line change 21
21
import numpy as np
22
22
import tensorflow as tf
23
23
24
- from tensorflow .python .keras .engine .base_layer import Layer
25
24
from tensorflow_model_optimization .python .core .quantization .keras import quantize_annotate
26
25
from tensorflow_model_optimization .python .core .quantization .keras import quantize_config as quantize_config_mod
27
26
@@ -54,7 +53,7 @@ def get_config(self):
54
53
55
54
def testAnnotateLayerCallPassesTraningBoolean (self ):
56
55
57
- class MockLayer (Layer ):
56
+ class MockLayer (tf . keras . layers . Layer ):
58
57
self .training = None
59
58
60
59
def call (self , training = None ):
You can’t perform that action at this time.
0 commit comments