Exports a tf.Module (and subclasses) obj to SavedModel format.

Used in the notebooks

Used in the guide Used in the tutorials

The obj must inherit from the Trackable class.

Example usage:

class Adder(tf.Module):
  @tf.function(input_signature=[tf.TensorSpec(shape=[], dtype=tf.float32)])
  def add(self, x):
    return x + x
model = Adder(), '/tmp/adder')

The resulting SavedModel is then servable with an input named "x", a scalar with dtype float32.


Signatures define the input and output types for a computation. The optional save signatures a