code: def createModelWithInvalidOutputShape(self):
      input1 = tf.keras.layers.Input(shape=(1,), name="input_1")
      input2 = tf.keras.layers.Input(shape=(1,), name="input_2")
      inputs = [input1, input2]
      input_layer = tf.keras.layers.concatenate(inputs)
      output_layer = tf.keras.layers.Dense(
          2, activation=tf.nn.sigmoid, name="output"
      )(input_layer)
      # Flatten the layer such that the first dimension no longer corresponds
      # with the batch size.
      reshape_layer = tf.keras.layers.Lambda(
          lambda x: tf.reshape(x, [-1]), name="reshape"
      )(output_layer)
      model = tf.keras.models.Model(inputs, reshape_layer)
  
      @tf.function
      def serving_default(serialized_tf_examples):
          parsed_features = tf.io.parse_example(
              serialized_tf_examples,
              {
                  "input_1": tf.io.FixedLenFeature(
                      [1], dtype=tf.float32
                  ),
                  "input_2": tf.io.FixedLenFeature(
                      [1], dtype=tf.float32
                  ),
              },
          )
          return model(parsed_features)
  
      input_spec = tf.TensorSpec(
          shape=(None,), dtype=tf.string, name="examples"
      )
      signatures = {
          "serving_default": serving_default.get_concrete_function(
              input_spec
          ),
      }
  
      export_path = tempfile.mkdtemp()
      model.save(export_path, save_format="tf", signatures=signatures)
      return export_path
  
imports: import tempfile
  import unittest
  from absl.testing import parameterized
  import apache_beam
  from apache_beam.testing import util
  import numpy
  import tensorflow
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.eval_saved_model import testutil
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.utils import model_util
  from tensorflow_model_analysis.utils import util
  from tfx_bsl.tfxio import tf_example_record
  from google.protobuf import text_format
  from tensorflow.core.protobuf import saved_model_pb2
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 4 for calling the ModelUtilTest obj's underlying member method code with example usage: obj.createModelWithInvalidOutputShape() and returns: export_path, model