def test_lstm_conversion_static_shapes(self, compute_unit, backend):
        '''
        Test that intermediate tensor shapes are populated correctly by the converter.
        That is, there are no symbolic dimensions in the shapes, when conversion is
        performed with a fixed input shape, irrespective of the shape used in the source model definition.
        '''
        def _get_keras_simple_lstm_model(input_shape):
            input = tf.keras.Input(batch_input_shape=input_shape)
            output = tf.keras.layers.LSTM(5)(input)
            keras_model = tf.keras.Model(inputs=input, outputs=output)
            return keras_model

        def _test_for_symbolic_shapes(keras_input_shape, input_shape_for_conversion, are_symbols_expected):
            keras_model = _get_keras_simple_lstm_model(keras_input_shape)
            res = TensorFlowBaseTest.run_compare_tf_keras(
                keras_model,
                [random_gen((1, 32, 10), -1, 1)],
                inputs_for_conversion=[ct.TensorType(shape=input_shape_for_conversion)],
                compute_unit=compute_unit,
                backend=backend,
            )
            coreml_model = res[1]
            mil_prog = coreml_model._get_mil_internal()
            assert is_symbolic_dim_in_prog(mil_prog) == are_symbols_expected

        _test_for_symbolic_shapes(keras_input_shape=(1, 32, 10),
                                  input_shape_for_conversion=(1, 32, 10),
                                  are_symbols_expected=False)

        _test_for_symbolic_shapes(keras_input_shape=(None, 32, 10),
                                  input_shape_for_conversion=(1, 32, 10),
                                  are_symbols_expected=False)

        _test_for_symbolic_shapes(keras_input_shape=(None, None, 10),
                                  input_shape_for_conversion=(1, 32, 10),
                                  are_symbols_expected=False)

        _test_for_symbolic_shapes(keras_input_shape=(None, 32, 10),
                                  input_shape_for_conversion=(ct.RangeDim(1, 10), 32, 10),
                                  are_symbols_expected=True)

        if backend[0] != "mlprogram":
            # FIX ME: model load fails if backend is "mlprogram". rdar://84862138
            _test_for_symbolic_shapes(keras_input_shape=(None, None, 10),
                                      input_shape_for_conversion=(ct.RangeDim(1, 10), ct.RangeDim(16, 64), 10),
                                      are_symbols_expected=True)

        Test that intermediate tensor shapes are populated correctly by the converter.
        That is, there are no symbolic dimensions in the shapes, when conversion is
        performed with a fixed input shape, irrespective of the shape used in the source model definition.
        
coremltools/converters/mil/frontend/tensorflow2/test/test_v2_ops_tf_keras.py