class_docstr: This class regularly exports the EvalSavedModel.
  
  In addition to exporting, this class also garbage collects stale exports.
class_docstr_tok: ["This","class","regularly","exports","the","EvalSavedModel",".","In","addition","to","exporting",",","this","class","also","garbage","collects","stale","exports","."]
docstr: Create an `Exporter` to use with `tf.estimator.EvalSpec`.
  
  Args:
    name: Unique name of this `Exporter` that is going to be used in the
      export path.
    eval_input_receiver_fn: Eval input receiver function.
    serving_input_receiver_fn: (Optional) Serving input receiver function. We
      recommend that you provide this as well, so that the exported SavedModel
      also contains the serving graph. If not provided, the serving graph will
      not be included in the exported SavedModel.
    exports_to_keep: Number of exports to keep.  Older exports will be
      garbage-collected.  Defaults to 5.  Set to `None` to disable garbage
      collection.
    assets_extra: An optional dict specifying how to populate the assets.extra
      directory within the exported SavedModel.  Each key should give the
      destination path (including the filename) relative to the assets.extra
      directory.  The corresponding value gives the full path of the source
      file to be copied.  For example, the simple case of copying a single
      file without renaming it is specified as
      `{'my_asset_file.txt': '/path/to/my_asset_file.txt'}`.
  
  Raises:
    ValueError: if exports_to_keep is set to a non-positive value.
docstr_tok: ["Create","an","`","Exporter","`","to","use","with","`","tf.estimator.EvalSpec","`",".","Args",":","name",":","Unique","name","of","this","`","Exporter","`","that","is","going","to","be","used","in","the","export","path",".","eval_input_receiver_fn",":","Eval","input","receiver","function",".","serving_input_receiver_fn",":","(","Optional",")","Serving","input","receiver","function",".","We","recommend","that","you","provide","this","as","well",",","so","that","the","exported","SavedModel","also","contains","the","serving","graph",".","If","not","provided",",","the","serving","graph","will","not","be","included","in","the","exported","SavedModel",".","exports_to_keep",":","Number","of","exports","to","keep",".","Older","exports","will","be","garbage-collected",".","Defaults","to","5",".","Set","to","`","None","`","to","disable","garbage","collection",".","assets_extra",":","An","optional","dict","specifying","how","to","populate","the","assets.extra","directory","within","the","exported","SavedModel",".","Each","key","should","give","the","destination","path","(","including","the","filename",")","relative","to","the","assets.extra","directory",".","The","corresponding","value","gives","the","full","path","of","the","source","file","to","be","copied",".","For","example",",","the","simple","case","of","copying","a","single","file","without","renaming","it","is","specified","as","`","{","'my_asset_file.txt","'",":","'\/path\/to\/my_asset_file.txt","'","}","`",".","Raises",":","ValueError",":","if","exports_to_keep","is","set","to","a","non-positive","value","."]
code: def __init__(
      self,
      name: str,
      eval_input_receiver_fn: Callable[
          [], export.EvalInputReceiverType
      ],
      serving_input_receiver_fn: Optional[
          Callable[[], tf_estimator.export.ServingInputReceiver]
      ] = None,
      exports_to_keep: int = 5,
      assets_extra: Optional[Dict[str, str]] = None,
  ):
      """Create an `Exporter` to use with `tf.estimator.EvalSpec`.
  
      Args:
        name: Unique name of this `Exporter` that is going to be used in the
          export path.
        eval_input_receiver_fn: Eval input receiver function.
        serving_input_receiver_fn: (Optional) Serving input receiver function. We
          recommend that you provide this as well, so that the exported SavedModel
          also contains the serving graph. If not provided, the serving graph will
          not be included in the exported SavedModel.
        exports_to_keep: Number of exports to keep.  Older exports will be
          garbage-collected.  Defaults to 5.  Set to `None` to disable garbage
          collection.
        assets_extra: An optional dict specifying how to populate the assets.extra
          directory within the exported SavedModel.  Each key should give the
          destination path (including the filename) relative to the assets.extra
          directory.  The corresponding value gives the full path of the source
          file to be copied.  For example, the simple case of copying a single
          file without renaming it is specified as
          `{'my_asset_file.txt': '/path/to/my_asset_file.txt'}`.
  
      Raises:
        ValueError: if exports_to_keep is set to a non-positive value.
      """
      self._eval_saved_model_exporter = _EvalSavedModelExporter(
          name=name,
          eval_input_receiver_fn=eval_input_receiver_fn,
          serving_input_receiver_fn=serving_input_receiver_fn,
          assets_extra=assets_extra,
      )
      self._exports_to_keep = exports_to_keep
      if exports_to_keep is not None and exports_to_keep <= 0:
          raise ValueError(
              "`exports_to_keep`, if provided, must be positive number"
          )
  
imports: from collections import abc
  import contextlib
  import os
  import types
  from typing import Callable, Dict, List, Optional, Union
  from tensorflow import estimator
  from tensorflow_model_analysis.eval_saved_model import export
  from tensorflow_model_analysis.utils import util
  from tensorflow.python.estimator import gc
  from tensorflow.python.framework import errors_impl
  from tensorflow.python.platform import gfile
  from tensorflow.python.platform import tf_logging
label_desc: Use image node_id 1 to create a new LatestExporter object from inherited base classes: tf_estimator with example: obj = LatestExporter(name, eval_input_receiver_fn, serving_input_receiver_fn, exports_to_keep, assets_extra)