From 42d67989fffafb836cd055e8db83d6938850b2df Mon Sep 17 00:00:00 2001 From: divyashreepathihalli Date: Tue, 7 Nov 2023 16:17:26 +0000 Subject: [PATCH] update init --- keras_cv/backend/__init__.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/keras_cv/backend/__init__.py b/keras_cv/backend/__init__.py index 0e40b8e643..296d42b397 100644 --- a/keras_cv/backend/__init__.py +++ b/keras_cv/backend/__init__.py @@ -24,11 +24,12 @@ import types +from keras_cv.backend.config import ( + detect_if_tensorflow_uses_keras_3, + multi_backend, +) from packaging.version import parse -from keras_cv.backend.config import detect_if_tensorflow_uses_keras_3 -from keras_cv.backend.config import multi_backend - # Keys are of the form: "module.where.attr.exists->module.where.to.alias" # Value are of the form: ["attr1", "attr2", ...] or # [("attr1_original_name", "attr1_alias_name")] @@ -41,10 +42,7 @@ ], "models->saving": ["load_model"], } - -if detect_if_tensorflow_uses_keras_3(): - from tensorflow import keras -elif multi_backend(): +if multi_backend(): import keras if not hasattr(keras, "__version__") or parse(keras.__version__) < parse(