code: def test_tf2keras_optional_input(backend):
      input_dim = 3
      # None denotes seq_len dimension
      x1 = tf.keras.Input(
          shape=(None, input_dim), name="optional_input"
      )
      x2 = tf.keras.Input(
          shape=(None, input_dim), name="required_input"
      )
      y = x1 + x2
      keras_model = tf.keras.Model(inputs=[x1, x2], outputs=[y])
  
      upper_bound = -1 if backend[0] == "neuralnetwork" else 2
      seq_len_dim = ct.RangeDim(upper_bound=upper_bound)
      default_value = np.ones((1, 2, input_dim)).astype(np.float32)
      optional_input = ct.TensorType(
          name="optional_input",
          shape=(1, seq_len_dim, input_dim),
          default_value=default_value,
      )
      required_input = ct.TensorType(
          name="required_input",
          shape=(1, seq_len_dim, input_dim),
      )
      mlmodel = ct.convert(
          keras_model,
          inputs=[optional_input, required_input],
          convert_to=backend[0],
      )
  
      batch = 1
      seq_len = 2
      test_input_x2 = np.random.rand(batch, seq_len, input_dim).astype(
          np.float32
      )
      expected_val = keras_model([default_value, test_input_x2])
      if ct.utils._is_macos():
          results = mlmodel.predict({"required_input": test_input_x2})
          np.testing.assert_allclose(
              results["Identity"], expected_val, rtol=1e-2
          )
  
imports: import itertools
  import os
  import platform
  from os import chdir, getcwd
  from shutil import rmtree
  from tempfile import mkdtemp
  import numpy
  import pytest
  import coremltools
  from coremltools.converters.mil.frontend.tensorflow.test.test_tf_conversion_api import TestInputOutputConversionAPI
  from coremltools.converters.mil.frontend.tensorflow.test.test_tf_conversion_api import TestiOS16DefaultIODtype
  from coremltools.converters.mil.mil import types
  from coremltools.converters.mil.testing_reqs import backends
  import tensorflow
  from tensorflow import keras
  from tensorflow.keras import layers
label_desc: Use image node_id 6 for calling the TestTF2FlexibleInput obj's underlying member method code with example usage: obj.test_tf2keras_optional_input(backend) without return types