code: def test_convert_from_saved_model_dir(tmpdir, backend):
      # Sample input
      test_input = np.random.rand(1, 3, 5) - 0.5
  
      # create the model to convert
      with tf.compat.v1.Session() as sess:
          x = tf.placeholder(shape=(1, 3, 5), dtype=tf.float32)
          y = tf.nn.relu(x)
  
          expected_val = sess.run(y, feed_dict={x: test_input})
  
      # Save model as SavedModel
      inputs = {"x": x}
      outputs = {"y": y}
      save_path = str(tmpdir)
      tf.compat.v1.saved_model.simple_save(
          sess, save_path, inputs, outputs
      )
  
      # SavedModel directory generated by TensorFlow 1.x
      # when converting from SavedModel dir, inputs / outputs are optional
      mlmodel = ct.convert(
          save_path,
          convert_to=backend[0],
          compute_units=ct.ComputeUnit.CPU_ONLY,
      )
  
      # Need input output names to call mlmodel
      # x.name == 'Placeholder:0'. Strip out ':0'
      input_name = x.name.split(":")[0]
      results = mlmodel.predict({input_name: test_input})
      # y.name == 'Relu:0'. output_name == 'Relu'
      output_name = y.name.split(":")[0]
      np.testing.assert_allclose(results[output_name], expected_val)
  
imports: import itertools
  import os
  import tempfile
  import numpy
  import pytest
  import coremltools
  from coremltools._deps import _HAS_TF_1, _HAS_TF_2, MSG_TF1_NOT_FOUND
  from coremltools.converters.mil.testing_reqs import backends, compute_units
  from coremltools.converters.mil.testing_utils import assert_cast_ops_count, assert_input_dtype, assert_ops_in_mil_program, assert_output_dtype, assert_prog_input_type, assert_prog_output_type, assert_spec_input_image_type, assert_spec_output_image_type, get_op_types_in_program, verify_prediction
  from coremltools.proto import FeatureTypes_pb2
  from coremltools.test.api.test_api_examples import TestInputs
label_desc: Use image node_id 3 for calling the TestTensorFlow1ConverterExamples obj's underlying member method code with example usage: obj.test_convert_from_saved_model_dir(tmpdir, backend) without return types