File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
tensorflow_model_optimization/python/core/quantization/keras/default_8bit Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 29
29
from tensorflow_model_optimization .python .core .quantization .keras .graph_transformations import transforms
30
30
31
31
try :
32
- from keras .backend import unique_object_name # pylint: disable=g-import-not-at-top
32
+ # OSS
33
+ import keras # pylint: disable=g-import-not-at-top
34
+ if hasattr (keras , 'src' ):
35
+ # Path as seen in pip packages as of TF/Keras 2.13.
36
+ from keras .src .backend import unique_object_name # pylint: disable=g-import-not-at-top
37
+ else :
38
+ from keras .backend import unique_object_name # pylint: disable=g-import-not-at-top,g-importing-member
33
39
except ImportError :
34
- # Path as seen in pip packages as of TF/Keras 2.13.
35
- from keras .src .backend import unique_object_name # pylint: disable=g-import-not-at-top
40
+ # Internal
41
+ unique_object_name = tf ._keras_internal .backend .unique_object_name # pylint: disable=protected-access
42
+
36
43
37
44
LayerNode = transforms .LayerNode
38
45
LayerPattern = transforms .LayerPattern
You can’t perform that action at this time.
0 commit comments