class_docstr: Abstract class for generators.
class_docstr_tok: ["Abstract","class","for","generators","."]
docstr: Constructs a BaseSequenceGenerator.
  
  Args:
    model: An instance of BaseModel.
    details: A generator_pb2.GeneratorDetails for this generator.
    checkpoint: Where to look for the most recent model checkpoint. Either a
        directory to be used with tf.train.latest_checkpoint or the path to a
        single checkpoint file. Or None if a bundle should be used.
    bundle: A generator_pb2.GeneratorBundle object that contains both a
        checkpoint and a metagraph. Or None if a checkpoint should be used.
  
  Raises:
    SequenceGeneratorError: if neither checkpoint nor bundle is set.
docstr_tok: ["Constructs","a","BaseSequenceGenerator",".","Args",":","model",":","An","instance","of","BaseModel",".","details",":","A","generator_pb2.GeneratorDetails","for","this","generator",".","checkpoint",":","Where","to","look","for","the","most","recent","model","checkpoint",".","Either","a","directory","to","be","used","with","tf.train.latest_checkpoint","or","the","path","to","a","single","checkpoint","file",".","Or","None","if","a","bundle","should","be","used",".","bundle",":","A","generator_pb2.GeneratorBundle","object","that","contains","both","a","checkpoint","and","a","metagraph",".","Or","None","if","a","checkpoint","should","be","used",".","Raises",":","SequenceGeneratorError",":","if","neither","checkpoint","nor","bundle","is","set","."]
code: def __init__(self, model, details, checkpoint, bundle):
      """Constructs a BaseSequenceGenerator.
  
      Args:
        model: An instance of BaseModel.
        details: A generator_pb2.GeneratorDetails for this generator.
        checkpoint: Where to look for the most recent model checkpoint. Either a
            directory to be used with tf.train.latest_checkpoint or the path to a
            single checkpoint file. Or None if a bundle should be used.
        bundle: A generator_pb2.GeneratorBundle object that contains both a
            checkpoint and a metagraph. Or None if a checkpoint should be used.
  
      Raises:
        SequenceGeneratorError: if neither checkpoint nor bundle is set.
      """
      self._model = model
      self._details = details
      self._checkpoint = checkpoint
      self._bundle = bundle
  
      if self._checkpoint is None and self._bundle is None:
          raise SequenceGeneratorError(
              "Either checkpoint or bundle must be set"
          )
      if self._checkpoint is not None and self._bundle is not None:
          raise SequenceGeneratorError(
              "Checkpoint and bundle cannot both be set"
          )
  
      if self._bundle:
          if self._bundle.generator_details.id != self._details.id:
              raise SequenceGeneratorError(
                  "Generator id in bundle (%s) does not match this generator's id "
                  "(%s)"
                  % (
                      self._bundle.generator_details.id,
                      self._details.id,
                  )
              )
  
      self._initialized = False
  
imports: import abc
  import os
  import tempfile
  from note_seq.protobuf import generator_pb2
  import tensorflow.compat.v1
label_desc: Use image node_id 1 to create a new BaseSequenceGenerator object from inherited base classes: object with example: obj = BaseSequenceGenerator(model, details, checkpoint, bundle)