Skip to content

Commit 53c64f7

Browse files
authored
Align config with Keras NLP (#2217) (#2218)
1 parent ad19601 commit 53c64f7

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

keras_cv/backend/config.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,6 @@
1313
# limitations under the License.
1414

1515

16-
from tensorflow import keras
17-
18-
# We follow the version of keras that tensorflow is configured to use.
19-
_USE_KERAS_3 = False
20-
21-
# Note that only recent versions of keras have a `version()` function.
22-
if hasattr(keras, "version") and keras.version().startswith("3."):
23-
_USE_KERAS_3 = True
24-
25-
2616
def detect_if_tensorflow_uses_keras_3():
2717
# We follow the version of keras that tensorflow is configured to use.
2818
try:
@@ -44,8 +34,6 @@ def detect_if_tensorflow_uses_keras_3():
4434

4535

4636
_USE_KERAS_3 = detect_if_tensorflow_uses_keras_3()
47-
if _USE_KERAS_3:
48-
_MULTI_BACKEND = True
4937

5038

5139
def keras_3():
@@ -58,4 +46,6 @@ def backend():
5846
if not keras_3():
5947
return "tensorflow"
6048

49+
import keras
50+
6151
return keras.config.backend()

0 commit comments

Comments
 (0)