Pipeline

class dragon.vm.dali.Pipeline(
  batch_size=1,
  num_threads=1,
  seed=3,
  prefetch_queue_depth=2,
  py_num_workers=1,
  **kwargs
)[source]

The base pipeline class to define operations.

class MyPipeline(dali.Pipeline):
    def __init__(batch_size=1, num_threads=4):
        super(MyPipeline, self).__init__(batch_size, num_threads)

__init__

Pipeline.__init__(
  batch_size=1,
  num_threads=1,
  seed=3,
  prefetch_queue_depth=2,
  py_num_workers=1,
  **kwargs
)[source]

Create a Pipeline

Parameters:
  • batch_size (int, optional, default=1) – The number of examples in a batch.
  • num_threads (int, optional, default=1) – The number of threads to execute the operations.
  • seed (int, optional, default=3) – The seed for random generator.
  • prefetch_queue_depth (int, optional, default=2) – The number of prefetch queues.
  • py_num_workers (int, optional, default=1) – The number of workers to process external source.

Properties

device_id

Pipeline.device_id

Return the device index of pipeline.

Returns:
int – The device index.

max_batch_size

Pipeline.max_batch_size

Return the maximum batch size of pipeline.

Returns:
int – The maximum batch size.

num_threads

Pipeline.num_threads

Return the number of threads to execute pipeline.

Returns:
int – The number of threads.

Methods

build

Pipeline.build(define_graph=None)[source]

Build the pipeline.

Parameters:
  • define_graph (callable, optional) – The defined function to use instead.

define_graph

Pipeline.define_graph()[source]

Define the symbolic operations for pipeline.

feed_input

Pipeline.feed_input(
  *args,
  **kwargs
)[source]

Bind an array to the edge reference.