parameters: (serving_input_fn,
                           default_output_alternative_key=None,
                           assets_extra=None,
                           as_text=False,
                           exports_to_keep=5,
                           strip_default_attrs=None)
return_statement: return export_strategy.ExportStrategy('Servo', export_fn, strip_default_attrs)
docstring: Create an ExportStrategy for use with Experiment.
  
    Args:
      serving_input_fn: A function that takes no arguments and returns an
        `InputFnOps`.
      default_output_alternative_key: the name of the head to serve when an
        incoming serving request does not explicitly request a specific head.
        Must be `None` if the estimator inherits from `tf.estimator.Estimator`
        or for single-headed models.
      assets_extra: A 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'}`.
      as_text: whether to write the SavedModel proto in text format.
      exports_to_keep: Number of exports to keep.  Older exports will be
        garbage-collected.  Defaults to 5.  Set to None to disable garbage
        collection.
      strip_default_attrs: Boolean. If True, default attrs in the
        `GraphDef` will be stripped on write. This is recommended for better
        forward compatibility of the resulting `SavedModel`.
  
    Returns:
      An ExportStrategy that can be passed to the Experiment constructor.
docstring_summary: Create an ExportStrategy for use with Experiment.
docstring_tokens: Create an ExportStrategy for use with Experiment .
function: def make_export_strategy(serving_input_fn,
                           default_output_alternative_key=None,
                           assets_extra=None,
                           as_text=False,
                           exports_to_keep=5,
                           strip_default_attrs=None):
    """Create an ExportStrategy for use with Experiment.
  
    Args:
      serving_input_fn: A function that takes no arguments and returns an
        `InputFnOps`.
      default_output_alternative_key: the name of the head to serve when an
        incoming serving request does not explicitly request a specific head.
        Must be `None` if the estimator inherits from `tf.estimator.Estimator`
        or for single-headed models.
      assets_extra: A 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'}`.
      as_text: whether to write the SavedModel proto in text format.
      exports_to_keep: Number of exports to keep.  Older exports will be
        garbage-collected.  Defaults to 5.  Set to None to disable garbage
        collection.
      strip_default_attrs: Boolean. If True, default attrs in the
        `GraphDef` will be stripped on write. This is recommended for better
        forward compatibility of the resulting `SavedModel`.
  
    Returns:
      An ExportStrategy that can be passed to the Experiment constructor.
    """
  
    def export_fn(estimator, export_dir_base, checkpoint_path=None,
                  strip_default_attrs=False):
      """Exports the given Estimator as a SavedModel.
  
      Args:
        estimator: the Estimator to export.
        export_dir_base: A string containing a directory to write the exported
          graph and checkpoints.
        checkpoint_path: The checkpoint path to export.  If None (the default),
          the most recent checkpoint found within the model directory is chosen.
        strip_default_attrs: Boolean. If `True`, default-valued attributes will
          be removed from the NodeDefs.
  
      Returns:
        The string path to the exported directory.
  
      Raises:
        ValueError: If `estimator` is a `tf.estimator.Estimator` instance
          and `default_output_alternative_key` was specified.
      """
      if isinstance(estimator, core_estimator.Estimator):
        if default_output_alternative_key is not None:
          raise ValueError(
              'default_output_alternative_key is not supported in core '
              'Estimator. Given: {}'.format(default_output_alternative_key))
        export_result = estimator.export_savedmodel(
            export_dir_base,
            serving_input_fn,
            assets_extra=assets_extra,
            as_text=as_text,
            checkpoint_path=checkpoint_path,
            strip_default_attrs=strip_default_attrs)
      else:
        export_result = estimator.export_savedmodel(
            export_dir_base,
            serving_input_fn,
            default_output_alternative_key=default_output_alternative_key,
            assets_extra=assets_extra,
            as_text=as_text,
            checkpoint_path=checkpoint_path,
            strip_default_attrs=strip_default_attrs)
  
      garbage_collect_exports(export_dir_base, exports_to_keep)
      return export_result
  
    return export_strategy.ExportStrategy('Servo', export_fn, strip_default_attrs)
function_tokens: def make_export_strategy ( serving_input_fn , default_output_alternative_key = None , assets_extra = None , as_text = False , exports_to_keep = 5 , strip_default_attrs = None ) : def export_fn ( estimator , export_dir_base , checkpoint_path = None , strip_default_attrs = False ) : """Exports the given Estimator as a SavedModel.
  
      Args:
        estimator: the Estimator to export.
        export_dir_base: A string containing a directory to write the exported
          graph and checkpoints.
        checkpoint_path: The checkpoint path to export.  If None (the default),
          the most recent checkpoint found within the model directory is chosen.
        strip_default_attrs: Boolean. If `True`, default-valued attributes will
          be removed from the NodeDefs.
  
      Returns:
        The string path to the exported directory.
  
      Raises:
        ValueError: If `estimator` is a `tf.estimator.Estimator` instance
          and `default_output_alternative_key` was specified.
      """ if isinstance ( estimator , core_estimator . Estimator ) : if default_output_alternative_key is not None : raise ValueError ( 'default_output_alternative_key is not supported in core ' 'Estimator. Given: {}' . format ( default_output_alternative_key ) ) export_result = estimator . export_savedmodel ( export_dir_base , serving_input_fn , assets_extra = assets_extra , as_text = as_text , checkpoint_path = checkpoint_path , strip_default_attrs = strip_default_attrs ) else : export_result = estimator . export_savedmodel ( export_dir_base , serving_input_fn , default_output_alternative_key = default_output_alternative_key , assets_extra = assets_extra , as_text = as_text , checkpoint_path = checkpoint_path , strip_default_attrs = strip_default_attrs ) garbage_collect_exports ( export_dir_base , exports_to_keep ) return export_result return export_strategy . ExportStrategy ( 'Servo' , export_fn , strip_default_attrs )