code: def test_shaping_utils(self, backend):
      @make_tf_graph([(None, 4, 5)])
      def build_flexible_model(x):
          return tf.nn.relu(x)
  
      model, inputs, outputs = build_flexible_model
      input_name = TFConverter._get_tensor_name(inputs[0])
      output_name = TFConverter._get_tensor_name(outputs[0])
  
      # static-Flexible shape
      if backend[0] == "neuralnetwork":
          inputs = [
              # Use TF's input shapes (None, 4, 5)
              TensorType(name=input_name)
          ]
      else:
          inputs = [
              TensorType(
                  name=input_name, shape=(RangeDim(upper_bound=3), 4, 5)
              )
          ]
  
      mlmodel = converter.convert(
          model,
          inputs=inputs,
          outputs=[output_name],
          convert_to=backend[0],
      )
      assert mlmodel is not None
      input_values = [random_gen((3, 4, 5), -10.0, 10.0)]
      input_dict = {input_name: input_values[0]}
      if _IS_MACOS:
          ret = mlmodel.predict(input_dict)
          np.allclose(
              ret[output_name], np.maximum(input_values[0], 0.0)
          )
  
      # Enumerate shape
      inputs_shape = [
          TensorType(
              input_name,
              EnumeratedShapes(shapes=[(3, 4, 5), (4, 4, 5)]),
          )
      ]
      mlmodel = converter.convert(
          model,
          inputs=inputs_shape,
          outputs=[output_name],
          convert_to=backend[0],
      )
      assert mlmodel is not None
      input_values = [random_gen((3, 4, 5), -10.0, 10.0)]
      input_dict = {input_name: input_values[0]}
      if _IS_MACOS:
          ret = mlmodel.predict(input_dict)
          np.allclose(
              ret[output_name], np.maximum(input_values[0], 0.0)
          )
  
      input_values = [random_gen((4, 4, 5), -10.0, 10.0)]
      input_dict = {input_name: input_values[0]}
      if _IS_MACOS:
          ret = mlmodel.predict(input_dict)
          np.allclose(
              ret[output_name], np.maximum(input_values[0], 0.0)
          )
  
      if _IS_MACOS:
          with pytest.raises(RuntimeError):
              input_values = [random_gen((5, 4, 5), -10.0, 10.0)]
              input_dict = {input_name: input_values[0]}
              ret = mlmodel.predict(input_dict)
  
      # Ranged shape
      inputs_shape = [TensorType(input_name, [RangeDim(3, 5), 4, 5])]
      mlmodel = converter.convert(
          model,
          inputs=inputs_shape,
          outputs=[output_name],
          convert_to=backend[0],
      )
      assert mlmodel is not None
      input_values = [random_gen((3, 4, 5), -10.0, 10.0)]
      input_dict = {input_name: input_values[0]}
      if _IS_MACOS:
          ret = mlmodel.predict(input_dict)
          np.allclose(
              ret[output_name], np.maximum(input_values[0], 0.0)
          )
  
      input_values = [random_gen((4, 4, 5), -10.0, 10.0)]
      input_dict = {input_name: input_values[0]}
      if _IS_MACOS:
          ret = mlmodel.predict(input_dict)
          np.allclose(
              ret[output_name], np.maximum(input_values[0], 0.0)
          )
  
      if _IS_MACOS:
          with pytest.raises(RuntimeError):
              input_values = [random_gen((2, 4, 5), -10.0, 10.0)]
              input_dict = {input_name: input_values[0]}
              ret = mlmodel.predict(input_dict)
  
imports: import os
  import shutil
  import tempfile
  import numpy
  import pytest
  import coremltools
  import coremltools.converters
  import coremltools.proto.FeatureTypes_pb2
  from coremltools import EnumeratedShapes, ImageType, RangeDim, TensorType
  from coremltools._deps import _HAS_TF_1, _IS_MACOS, MSG_TF1_NOT_FOUND
  from coremltools.converters.mil.frontend.tensorflow.converter import TFConverter
  from coremltools.converters.mil.frontend.tensorflow.test.testing_utils import TensorFlowBaseTest, get_tf_keras_io_names, make_tf_graph
  from coremltools.converters.mil.testing_reqs import backends
  from coremltools.converters.mil.testing_utils import random_gen
label_desc: Use image node_id 14 for calling the TestTfModelInputsOutputs obj's underlying member method code with example usage: obj.test_shaping_utils(backend) and returns: tf