code: def _save_model_with_dict_input_output(export_dir):
      """Writes SavedModel using dicts to compute x+y, x+2y and maybe x-y."""
  
      @tf.function
      def call_fn(d, return_dict=False):
          x = d["x"]
          y = d["y"]
          sigma = tf.concat([tf.add(x, y), tf.add(x, 2 * y)], axis=-1)
          if return_dict:
              return dict(sigma=sigma, delta=tf.subtract(x, y))
          else:
              return sigma
  
      # Trigger traces.
      d_spec = dict(
          x=tf.TensorSpec(shape=(None, 1), dtype=tf.float32),
          y=tf.TensorSpec(shape=(None, 1), dtype=tf.float32),
      )
      for return_dict in (False, True):
          call_fn.get_concrete_function(d_spec, return_dict=return_dict)
  
      obj = tf.train.Checkpoint()
      obj.__call__ = call_fn
      tf.saved_model.save(obj, export_dir)
  
imports: import json
  import os
  from absl.testing import parameterized
  import numpy
  import tensorflow
  import tensorflow_hub
label_desc: Use image node_id 10 for calling a global function with example usage: _save_model_with_dict_input_output(export_dir) and returns: dict, sigma