diff --git a/tests/python/frontend/keras/test_forward.py b/tests/python/frontend/keras/test_forward.py index 347c9878e52ef..56a7f3a15b3d7 100644 --- a/tests/python/frontend/keras/test_forward.py +++ b/tests/python/frontend/keras/test_forward.py @@ -62,8 +62,8 @@ def pytest_generate_tests(metafunc): # Scenarios: # - classic keras, using keras from "import keras" # - tensorflow keras, using keras from "from tensorflow import keras as tf_keras" -using_classic_keras = ("keras", {"keras": keras}) -using_tensorflow_keras = ("tf_keras", {"keras": tf_keras}) +using_classic_keras = ("keras", {"keras_": keras}) +using_tensorflow_keras = ("tf_keras", {"keras_": tf_keras}) def verify_keras_frontend(keras_model, need_transpose=True, layout="NCHW"): @@ -115,7 +115,7 @@ def to_channels_last(arr): def get_mobilenet(keras_): - if hasattr(keras.applications, "MobileNet"): + if hasattr(keras_.applications, "MobileNet"): # Keras 2.4.x and older MobileNet = keras_.applications.MobileNet else: @@ -167,7 +167,7 @@ def test_forward_merge_dot(self, keras_): ] for merge_func in merge_funcs: out = merge_func([data1, data2]) - keras_model = keras.models.Model([data1, data2], out) + keras_model = keras_.models.Model([data1, data2], out) verify_keras_frontend(keras_model) def test_forward_activations(self, keras_): @@ -255,7 +255,7 @@ def test_forward_conv1d(self, keras_): keras_.layers.Conv1D(filters=1, kernel_size=(3,), padding="valid", use_bias=False), keras_.layers.Conv1D(filters=10, kernel_size=(2,), padding="valid"), # Enable when relay conv1dtranspose handles NWC - # keras_.layers.Conv1DTranspose(filters=10, kernel_size=(3), padding="valid"), + # keras.layers.Conv1DTranspose(filters=10, kernel_size=(3), padding="valid"), ] for conv_func in conv_funcs: x = conv_func(data)