Skip to content

Commit

Permalink
Update keras.backend for keras 3.
Browse files Browse the repository at this point in the history
Signed-off-by: Jay Zhang <[email protected]>
  • Loading branch information
fatcat-z committed Nov 25, 2024
1 parent 445a89e commit 77e5c39
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/keras2onnx_unit_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@

K = keras.backend

def is_keras_3():
return tf.__version__.startswith("2.18") or tf.__version__.startswith("2.17") or tf.__version__.startswith("2.16")

if is_keras_3():
import tf_keras
K = tf_keras.backend

@pytest.fixture(scope='function')
def runner():
Expand Down

0 comments on commit 77e5c39

Please sign in to comment.