code: def to_saved_model(config, sess, inputs: dict, outputs: dict):
      """Save model to tensorflow SavedModel."""
      export_path_base = config["solver"]["service"]["model_path"]
      model_version = config["solver"]["service"]["model_version"]
      export_path = os.path.join(
          tf.compat.as_bytes(export_path_base),
          tf.compat.as_bytes(model_version),
      )
      export_path = os.path.abspath(export_path)
      logging.info("Exporting model to: {}".format(export_path))
      if os.path.exists(export_path):
          files = [
              one.decode()
              for one in os.listdir(export_path)
              if isinstance(one, bytes)
          ]
          if "variables" in files:
              cmd = (
                  input(
                      f"Export directory already exists, and isn't empty. Overwrite? [y/n]"
                  )
                  .strip()
                  .lower()
              )
              if cmd == "" or cmd == "y":
                  shutil.rmtree(export_path)
      builder = tf.saved_model.builder.SavedModelBuilder(export_path)
      # Build the signature_def_map.
      signature_def = tf.saved_model.predict_signature_def(
          inputs, outputs
      )
      builder.add_meta_graph_and_variables(
          sess,
          [tf.saved_model.tag_constants.SERVING],
          signature_def_map={"infer": signature_def},
          strip_default_attrs=True,
      )
      builder.save(as_text=True)
      logging.info("Done exporting!")
  
file_path: delta/delta/utils/solver/utils/solver_utils.py
imports: import os
  import re
  from pathlib import Path
  import numpy
  import delta.compat
  from absl import logging
  import shutil
  from delta import utils
  from delta.utils import metrics
label_desc: Use image node_id 4 for calling a global function with example usage: to_saved_model(config, sess, inputs, outputs) without return types