code: def _save_model_with_hparams(export_dir):
      """Writes a Hub-style SavedModel to compute y = ax + b with hparams a, b."""
  
      @tf.function(
          input_signature=[
              tf.TensorSpec(shape=(None, 1), dtype=tf.float32),
              tf.TensorSpec(shape=(), dtype=tf.float32),
              tf.TensorSpec(shape=(), dtype=tf.float32),
          ]
      )
      def call_fn(x, a=1.0, b=0.0):
          return tf.add(tf.multiply(a, x), b)
  
      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 8 for calling a global function with example usage: _save_model_with_hparams(export_dir) and returns: tf