Skip to content

Commit

Permalink
more things to add
Browse files Browse the repository at this point in the history
Signed-off-by: szalpal <mszolucha@nvidia.com>
  • Loading branch information
szalpal committed Dec 1, 2020
1 parent ee4530a commit 60bf4f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 44 deletions.
7 changes: 5 additions & 2 deletions dali/python/nvidia/dali/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,13 @@ class Pipeline(object):
Parameters
----------
`batch_size` : int, optional, default = -1
Batch size of the pipeline. Negative values for this parameter
Maximum batch size of the pipeline. Negative values for this parameter
are invalid - the default value may only be used with
serialized pipeline (the value stored in serialized pipeline
is used instead).
is used instead). In most cases, the actual batch size of the pipeline
will be equal to the maximum one. Running DALI pipeline with batch size
smaller than that is supported. Batch size might change from iteration
to iteration of DALI pipeline.
`num_threads` : int, optional, default = -1
Number of CPU threads used by the pipeline.
Negative values for this parameter are invalid - the default
Expand Down
42 changes: 0 additions & 42 deletions dali/test/python/test_external_source_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,26 +416,6 @@ def iter_setup(self):
break
assert(iter_num == i)

def test_external_source_fail():
class ExternalSourcePipeline(Pipeline):
def __init__(self, batch_size, external_s_size, num_threads, device_id):
super(ExternalSourcePipeline, self).__init__(batch_size, num_threads, device_id)
self.input = ops.ExternalSource()
self.batch_size_ = batch_size
self.external_s_size_ = external_s_size

def define_graph(self):
self.batch = self.input()
return [self.batch]

def iter_setup(self):
batch = datapy.zeros([self.external_s_size_,4,5])
self.feed_input(self.batch, batch)

batch_size = 3
pipe = ExternalSourcePipeline(batch_size, batch_size - 1, 3, 0)
pipe.build()
assert_raises(RuntimeError, pipe.run)

def test_external_source_fail_missing_output():
class ExternalSourcePipeline(Pipeline):
Expand All @@ -461,28 +441,6 @@ def iter_setup(self):
pipe.build()
assert_raises(RuntimeError, pipe.run)

def test_external_source_fail_list():
class ExternalSourcePipeline(Pipeline):
def __init__(self, batch_size, external_s_size, num_threads, device_id):
super(ExternalSourcePipeline, self).__init__(batch_size, num_threads, device_id)
self.input = ops.ExternalSource()
self.batch_size_ = batch_size
self.external_s_size_ = external_s_size

def define_graph(self):
self.batch = self.input()
return [self.batch]

def iter_setup(self):
batch = []
for _ in range(self.external_s_size_):
batch.append(datapy.zeros([3,4,5]))
self.feed_input(self.batch, batch)

batch_size = 3
pipe = ExternalSourcePipeline(batch_size, batch_size - 1, 3, 0)
pipe.build()
assert_raises(RuntimeError, pipe.run)

def external_data_veri(external_data, batch_size):
class ExternalSourcePipeline(Pipeline):
Expand Down

0 comments on commit 60bf4f2

Please sign in to comment.