class_docstr: Abstract class for generators.
class_docstr_tok: ["Abstract","class","for","generators","."]
docstr: Writes a generator_pb2.GeneratorBundle file in the specified location.
  
  Saves the checkpoint, metagraph, and generator id in one file.
  
  Args:
    bundle_file: Location to write the bundle file.
    bundle_description: A short, human-readable string description of this
        bundle.
  
  Raises:
    SequenceGeneratorError: if there is an error creating the bundle file.
docstr_tok: ["Writes","a","generator_pb2.GeneratorBundle","file","in","the","specified","location",".","Saves","the","checkpoint",",","metagraph",",","and","generator","id","in","one","file",".","Args",":","bundle_file",":","Location","to","write","the","bundle","file",".","bundle_description",":","A","short",",","human-readable","string","description","of","this","bundle",".","Raises",":","SequenceGeneratorError",":","if","there","is","an","error","creating","the","bundle","file","."]
code: def create_bundle_file(self, bundle_file, bundle_description=None):
      """Writes a generator_pb2.GeneratorBundle file in the specified location.
  
      Saves the checkpoint, metagraph, and generator id in one file.
  
      Args:
        bundle_file: Location to write the bundle file.
        bundle_description: A short, human-readable string description of this
            bundle.
  
      Raises:
        SequenceGeneratorError: if there is an error creating the bundle file.
      """
      if not bundle_file:
          raise SequenceGeneratorError(
              "Bundle file location not specified."
          )
      if not self.details.id:
          raise SequenceGeneratorError(
              "Generator id must be included in GeneratorDetails when creating "
              "a bundle file."
          )
  
      if not self.details.description:
          tf.logging.warn(
              "Writing bundle file with no generator description."
          )
      if not bundle_description:
          tf.logging.warn(
              "Writing bundle file with no bundle description."
          )
  
      self.initialize()
  
      tempdir = None
      try:
          tempdir = tempfile.mkdtemp()
          checkpoint_filename = os.path.join(tempdir, "model.ckpt")
  
          self._model.write_checkpoint_with_metagraph(
              checkpoint_filename
          )
  
          if not os.path.isfile(checkpoint_filename):
              raise SequenceGeneratorError(
                  "Could not read checkpoint file: %s"
                  % (checkpoint_filename)
              )
          metagraph_filename = checkpoint_filename + ".meta"
          if not os.path.isfile(metagraph_filename):
              raise SequenceGeneratorError(
                  "Could not read metagraph file: %s"
                  % (metagraph_filename)
              )
  
          bundle = generator_pb2.GeneratorBundle()
          bundle.generator_details.CopyFrom(self.details)
          if bundle_description:
              bundle.bundle_details.description = bundle_description
          with tf.gfile.Open(checkpoint_filename, "rb") as f:
              bundle.checkpoint_file.append(f.read())
          with tf.gfile.Open(metagraph_filename, "rb") as f:
              bundle.metagraph_file = f.read()
  
          with tf.gfile.Open(bundle_file, "wb") as f:
              f.write(bundle.SerializeToString())
      finally:
          if tempdir is not None:
              tf.gfile.DeleteRecursively(tempdir)
  
imports: import abc
  import os
  import tempfile
  from note_seq.protobuf import generator_pb2
  import tensorflow.compat.v1
label_desc: Use image node_id 10 for calling the BaseSequenceGenerator obj's underlying member method code with example usage: obj.create_bundle_file(bundle_file, bundle_description) without return types