Pipeline

class dragon.vm.dali.Pipeline(
  batch_size=1,
  num_threads=1,
  seed=3,
  prefetch_queue_depth=2
)[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
)[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.

Properties

batch_size

Pipeline.batch_size

Return the batch size of pipeline.

Returns:
int – The batch size.

device_id

Pipeline.device_id

Return the device index of pipeline.

Returns:
int – The device index.

num_threads

Pipeline.num_threads

Return the number of threads to execute pipeline.

Returns:
int – The number of threads.

Methods

build

Pipeline.build()[source]

Build the pipeline.

define_graph

Pipeline.define_graph()[source]

Define the symbolic operations for pipeline.

feed_input

Pipeline.feed_input(
  ref,
  data
)[source]

Bind an array to the edge reference.

Parameters:
  • ref (_EdgeReference) – The reference of a edge.
  • data (numpy.ndarray) – The array data.