MCPcopy Create free account
hub / github.com/NVIDIA/DALI / test_pool_one_task

Method test_pool_one_task

dali/test/python/test_pool.py:126–138  ·  view source on GitHub ↗
(self, start_method)

Source from the content-addressed store, hash-verified

124
125 @params(*start_methods)
126 def test_pool_one_task(self, start_method):
127 groups = [MockGroup.from_callback(simple_callback)]
128 with create_pool(
129 groups, keep_alive_queue_size=1, num_workers=1, start_method=start_method
130 ) as pool:
131 pids = get_pids(pool)
132 pid = pids[0]
133 tasks = [(SampleInfo(0, 0, 0, 0),)]
134 work_batch = TaskArgs.make_sample(SampleRange(0, 1, 0, 0))
135 pool.schedule_batch(context_i=0, work_batch=work_batch)
136 batch = pool.receive_batch(context_i=0)
137 for task, sample in zip(tasks, batch):
138 np.testing.assert_array_equal(answer(pid, *task), sample)
139
140 @params(*start_methods)
141 def test_pool_multi_task(self, start_method):

Callers

nothing calls this directly

Calls 9

SampleInfoClass · 0.90
SampleRangeClass · 0.90
create_poolFunction · 0.85
get_pidsFunction · 0.85
answerFunction · 0.85
from_callbackMethod · 0.80
make_sampleMethod · 0.80
receive_batchMethod · 0.80
schedule_batchMethod · 0.45

Tested by

no test coverage detected