File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed
Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change 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-
2616def 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
5139def 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 ()
You can’t perform that action at this time.
0 commit comments