class_docstr: Wrapper class for Mesh-TF models.
class_docstr_tok: ["Wrapper","class","for","Mesh-TF","models","."]
docstr: Exports a TensorFlow SavedModel.
  
  Args:
    export_dir: str, a directory in which to export SavedModels. Will use
      `model_dir` if unspecified.
    checkpoint_step: int, checkpoint to export. If -1 (default), use the
      latest checkpoint from the pretrained model directory.
    beam_size: int, a number >= 1 specifying the number of beams to use for
      beam search.
    temperature: float, a value between 0 and 1 (must be 0 if beam_size > 1)
      0.0 means argmax, 1.0 means sample according to predicted distribution.
    keep_top_k: integer, a value between 1 and the vocabulary size. When
      sampling, only pick tokens that are in the k most likely.
    vocabulary: vocabularies.Vocabulary object to use for tokenization, or
      None to use the default SentencePieceVocabulary.
    eval_with_score: If True, compute log-likelihood scores of targets.
      If False, do inference to generate outputs.
  
  Returns:
    The string path to the exported directory.
docstr_tok: ["Exports","a","TensorFlow","SavedModel",".","Args",":","export_dir",":","str",",","a","directory","in","which","to","export","SavedModels",".","Will","use","`","model_dir","`","if","unspecified",".","checkpoint_step",":","int",",","checkpoint","to","export",".","If","-1","(","default",")",",","use","the","latest","checkpoint","from","the","pretrained","model","directory",".","beam_size",":","int",",","a","number",">","=","1","specifying","the","number","of","beams","to","use","for","beam","search",".","temperature",":","float",",","a","value","between","0","and","1","(","must","be","0","if","beam_size",">","1",")","0.0","means","argmax",",","1.0","means","sample","according","to","predicted","distribution",".","keep_top_k",":","integer",",","a","value","between","1","and","the","vocabulary","size",".","When","sampling",",","only","pick","tokens","that","are","in","the","k","most","likely",".","vocabulary",":","vocabularies.Vocabulary","object","to","use","for","tokenization",",","or","None","to","use","the","default","SentencePieceVocabulary",".","eval_with_score",":","If","True",",","compute","log-likelihood","scores","of","targets",".","If","False",",","do","inference","to","generate","outputs",".","Returns",":","The","string","path","to","the","exported","directory","."]
code: def export(
      self,
      export_dir=None,
      checkpoint_step=-1,
      beam_size=1,
      temperature=1.0,
      keep_top_k=-1,
      vocabulary=None,
      eval_with_score=False,
  ):
      """Exports a TensorFlow SavedModel.
  
      Args:
        export_dir: str, a directory in which to export SavedModels. Will use
          `model_dir` if unspecified.
        checkpoint_step: int, checkpoint to export. If -1 (default), use the
          latest checkpoint from the pretrained model directory.
        beam_size: int, a number >= 1 specifying the number of beams to use for
          beam search.
        temperature: float, a value between 0 and 1 (must be 0 if beam_size > 1)
          0.0 means argmax, 1.0 means sample according to predicted distribution.
        keep_top_k: integer, a value between 1 and the vocabulary size. When
          sampling, only pick tokens that are in the k most likely.
        vocabulary: vocabularies.Vocabulary object to use for tokenization, or
          None to use the default SentencePieceVocabulary.
        eval_with_score: If True, compute log-likelihood scores of targets.
          If False, do inference to generate outputs.
  
      Returns:
        The string path to the exported directory.
      """
      if checkpoint_step == -1:
          checkpoint_step = utils.get_latest_checkpoint_from_dir(
              self._model_dir
          )
      _parse_operative_config(self._model_dir)
      with gin.unlock_config():
          gin.bind_parameter(
              "Bitransformer.decode.beam_size", beam_size
          )
          gin.bind_parameter(
              "Bitransformer.decode.temperature", temperature
          )
          gin.bind_parameter(
              "Bitransformer.decode.sampling_keep_top_k", keep_top_k
          )
  
      if vocabulary is None:
          vocabulary = utils.get_vocabulary()
      model_ckpt = "model.ckpt-" + str(checkpoint_step)
      export_dir = export_dir or self._model_dir
      estimator = self.estimator(
          vocabulary,
          disable_tpu=True,
          score_in_predict_mode=eval_with_score,
      )
      return mtf_utils.export_model(
          estimator,
          export_dir,
          vocabulary,
          self._sequence_length,
          self._model_type,
          batch_size=self.batch_size,
          checkpoint_path=os.path.join(self._model_dir, model_ckpt),
          eval_with_score=eval_with_score,
      )
  
imports: import functools
  import os
  import gin
  import gin.tf
  import mesh_tensorflow
  from mesh_tensorflow import optimize
  from mesh_tensorflow.transformer import dataset
  from mesh_tensorflow.transformer import learning_rate_schedules
  from mesh_tensorflow.transformer import utils
  from t5.models import mesh_transformer
  from t5.models import utils
  from t5.models.t5_model import T5Model
  import tensorflow.compat.v1
label_desc: Use image node_id 11 for calling the MtfModel obj's underlying member method code with example usage: obj.export(export_dir, checkpoint_step, beam_size, temperature, keep_top_k, vocabulary, eval_with_score) and returns: mtf_utils