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

Function run_two_outputs

dali/test/python/operator_2/test_python_function.py:348–359  ·  view source on GitHub ↗
(func)

Source from the content-addressed store, hash-verified

346
347
348def run_two_outputs(func):
349 pipe = BasicPipeline(BATCH_SIZE, NUM_WORKERS, DEVICE_ID, SEED, images_dir)
350 pyfunc_pipe = TwoOutputsPythonOperatorPipeline(
351 BATCH_SIZE, NUM_WORKERS, DEVICE_ID, SEED, images_dir, func
352 )
353 for it in range(ITERS):
354 (preprocessed_output,) = pipe.run()
355 output1, output2 = pyfunc_pipe.run()
356 for i in range(len(output1)):
357 pro1, pro2 = func(preprocessed_output.at(i))
358 assert numpy.array_equal(output1.at(i), pro1)
359 assert numpy.array_equal(output2.at(i), pro2)
360
361
362def test_split():

Callers 2

test_splitFunction · 0.85
test_mixed_typesFunction · 0.85

Calls 5

BasicPipelineClass · 0.70
funcFunction · 0.70
runMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected