'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:
SequenceGeneratorException: if neither checkpoint nor bundle is set.'

def __init__(self, model, details, checkpoint, bundle):

    self._model = model
    self._details = details
    self._checkpoint = checkpoint
    self._bundle = bundle
    if ((self._checkpoint is None) and (self._bundle is None)):
        raise SequenceGeneratorException('Either    checkpoint    or    bundle    must    be    set')
    if ((self._checkpoint is not None) and (self._bundle is not None)):
        raise SequenceGeneratorException('Checkpoint    and    bundle    cannot    both    be    set')
    if self._bundle:
        if (self._bundle.generator_details.id != self._details.id):
            raise SequenceGeneratorException(("Generator    id    in    bundle    (%s)    does    not    match    this    generator's    id    (%s)" % (self._bundle.generator_details.id, self._details.id)))
    self._initialized = False
