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 2929from tensorflow_model_optimization .python .core .quantization .keras .graph_transformations import transforms
3030
3131try :
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
3339except 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+
3643
3744LayerNode = transforms .LayerNode
3845LayerPattern = transforms .LayerPattern
You can’t perform that action at this time.
0 commit comments