def setup_class(cls):
        """Prepares tf model in different formats (keras model, h5 file, saved_model dir)."""
        input_1 = tf.keras.Input(shape=(None, None, 16), name="input_1")
        input_2 = tf.keras.Input(shape=(None, None, 4), name="input_2")
        x = tf.keras.layers.Dense(4, activation=tf.nn.relu)(input_1) + input_2
        outputs = tf.keras.layers.Dense(5, activation=tf.nn.softmax)(x)
        cls.model = tf.keras.Model(inputs=[input_1, input_2], outputs=outputs)

        cls.temp_dir = tempfile.TemporaryDirectory()
        cls.h5_model_path = os.path.join(cls.temp_dir.name, "tf_keras_model.h5")
        cls.model.save(cls.h5_model_path)
        cls.saved_model_path = os.path.join(cls.temp_dir.name, "saved_model")
        cls.model.save(cls.saved_model_path, save_format="tf")
Prepares tf model in different formats (keras model, h5 file, saved_model dir).
coremltools/converters/mil/test_inputs_outputs_shape.py