Skip to content

Commit

Permalink
update init
Browse files Browse the repository at this point in the history
  • Loading branch information
divyashreepathihalli committed Nov 7, 2023
1 parent 4883a17 commit 42d6798
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions keras_cv/backend/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand All @@ -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(
Expand Down

0 comments on commit 42d6798

Please sign in to comment.