Skip to content

Commit

Permalink
Align config with Keras NLP (#2217)
Browse files Browse the repository at this point in the history
  • Loading branch information
sampathweb authored Dec 6, 2023
1 parent 37ffac0 commit f64fba0
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions keras_cv/backend/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,6 @@
# limitations under the License.


from tensorflow import keras

# We follow the version of keras that tensorflow is configured to use.
_USE_KERAS_3 = False

# Note that only recent versions of keras have a `version()` function.
if hasattr(keras, "version") and keras.version().startswith("3."):
_USE_KERAS_3 = True


def detect_if_tensorflow_uses_keras_3():
# We follow the version of keras that tensorflow is configured to use.
try:
Expand All @@ -44,8 +34,6 @@ def detect_if_tensorflow_uses_keras_3():


_USE_KERAS_3 = detect_if_tensorflow_uses_keras_3()
if _USE_KERAS_3:
_MULTI_BACKEND = True


def keras_3():
Expand All @@ -58,4 +46,6 @@ def backend():
if not keras_3():
return "tensorflow"

import keras

return keras.config.backend()

0 comments on commit f64fba0

Please sign in to comment.