def write_saved_transform_from_session(
    session, inputs, outputs, export_path, as_text=False):
  """Write the current session as a SavedModel."""
  predict_signature_def = (
      tf.compat.v1.saved_model.signature_def_utils.predict_signature_def(
          inputs, outputs))

  builder = tf.compat.v1.saved_model.builder.SavedModelBuilder(export_path)
  builder.add_meta_graph_and_variables(
      session, [constants.TRANSFORM_TAG],
      signature_def_map={constants.TRANSFORM_SIGNATURE: predict_signature_def},
      assets_collection=tf.compat.v1.get_collection(
          tf.compat.v1.GraphKeys.ASSET_FILEPATHS))
  builder.save(as_text)
Write the current session as a SavedModel.
tensorflow_transform/saved/saved_transform_io.py