TensorFlow 1 version
 | 
  
     
    View source on GitHub
  
 | 
Builds a queue out of a data generator.
Inherits From: SequenceEnqueuer
tf.keras.utils.GeneratorEnqueuer(
    generator, use_multiprocessing=False, random_seed=None
)
The provided generator can be finite in which case the class will throw
a StopIteration exception.
Args | |
|---|---|
generator
 | 
a generator function which yields data | 
use_multiprocessing
 | 
use multiprocessing if True, otherwise threading | 
random_seed
 | 
Initial seed for workers, will be incremented by one for each worker. | 
Methods
get
get()
Creates a generator to extract data from the queue.
Skip the data if it is None.
| Yields | |
|---|---|
The next element in the queue, i.e. a tuple
(inputs, targets) or
(inputs, targets, sample_weights).
 | 
is_running
is_running()
start
start(
    workers=1, max_queue_size=10
)
Starts the handler's workers.
| Args | |
|---|---|
workers
 | 
Number of workers. | 
max_queue_size
 | 
queue size
(when full, workers could block on put())
 | 
stop
stop(
    timeout=None
)
Stops running threads and wait for them to exit, if necessary.
Should be called by the same thread which called start().
| Args | |
|---|---|
timeout
 | 
maximum time to wait on thread.join()
 | 
  TensorFlow 1 version
    View source on GitHub