class_docstr: This class invokes the base exporter and a series of rewriters.
class_docstr_tok: ["This","class","invokes","the","base","exporter","and","a","series","of","rewriters","."]
docstr: Exports the given `Estimator` to a specific format.
  
  Performs the export as defined by the base_exporter and invokes all of the
  specified rewriters.
  
  Args:
    estimator: the `Estimator` to export.
    export_path: A string containing a directory where to write the export.
    checkpoint_path: The checkpoint path to export.
    eval_result: The output of `Estimator.evaluate` on this checkpoint.
    is_the_final_export: This boolean is True when this is an export in the
      end of training.  It is False for the intermediate exports during the
      training. When passing `Exporter` to `tf.estimator.train_and_evaluate`
      `is_the_final_export` is always False if `TrainSpec.max_steps` is
      `None`.
  
  Returns:
    The string path to the base exported directory or `None` if export is
      skipped.
  
  Raises:
    RuntimeError: Unable to create a temporary rewrite directory.
docstr_tok: ["Exports","the","given","`","Estimator","`","to","a","specific","format",".","Performs","the","export","as","defined","by","the","base_exporter","and","invokes","all","of","the","specified","rewriters",".","Args",":","estimator",":","the","`","Estimator","`","to","export",".","export_path",":","A","string","containing","a","directory","where","to","write","the","export",".","checkpoint_path",":","The","checkpoint","path","to","export",".","eval_result",":","The","output","of","`","Estimator.evaluate","`","on","this","checkpoint",".","is_the_final_export",":","This","boolean","is","True","when","this","is","an","export","in","the","end","of","training",".","It","is","False","for","the","intermediate","exports","during","the","training",".","When","passing","`","Exporter","`","to","`","tf.estimator.train_and_evaluate","`","`","is_the_final_export","`","is","always","False","if","`","TrainSpec.max_steps","`","is","`","None","`",".","Returns",":","The","string","path","to","the","base","exported","directory","or","`","None","`","if","export","is","skipped",".","Raises",":","RuntimeError",":","Unable","to","create","a","temporary","rewrite","directory","."]
code: def export(
      self,
      estimator,
      export_path,
      checkpoint_path,
      eval_result,
      is_the_final_export,
  ):
      """Exports the given `Estimator` to a specific format.
  
      Performs the export as defined by the base_exporter and invokes all of the
      specified rewriters.
  
      Args:
        estimator: the `Estimator` to export.
        export_path: A string containing a directory where to write the export.
        checkpoint_path: The checkpoint path to export.
        eval_result: The output of `Estimator.evaluate` on this checkpoint.
        is_the_final_export: This boolean is True when this is an export in the
          end of training.  It is False for the intermediate exports during the
          training. When passing `Exporter` to `tf.estimator.train_and_evaluate`
          `is_the_final_export` is always False if `TrainSpec.max_steps` is
          `None`.
  
      Returns:
        The string path to the base exported directory or `None` if export is
          skipped.
  
      Raises:
        RuntimeError: Unable to create a temporary rewrite directory.
      """
      base_path = self._base_exporter.export(
          estimator,
          export_path,
          checkpoint_path,
          eval_result,
          is_the_final_export,
      )
      if not base_path:
          return None
  
      tmp_rewrite_folder = "tmp-rewrite-" + str(int(time.time()))
      tmp_rewrite_path = os.path.join(export_path, tmp_rewrite_folder)
      if fileio.exists(tmp_rewrite_path):
          raise RuntimeError(
              "Unable to create a unique temporary rewrite path."
          )
      fileio.makedirs(tmp_rewrite_path)
  
      _invoke_rewriter(
          base_path,
          tmp_rewrite_path,
          self._rewriter_inst,
          rewriter.ModelType.SAVED_MODEL,
          rewriter.ModelType.ANY_MODEL,
      )
  
      fileio.rmtree(base_path)
      fileio.rename(tmp_rewrite_path, base_path)
      return base_path
  
file_path: tfx/tfx/components/trainer/rewriting/converters.py
imports: import os
  import time
  from tensorflow import estimator
  from tfx.components.trainer.rewriting import rewriter
  from tfx.dsl.io import fileio
label_desc: Use image node_id 3 for calling the RewritingExporter obj's underlying member method code with example usage: obj.export(estimator, export_path, checkpoint_path, eval_result, is_the_final_export) and returns: base_path, None