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

Class PythonOperatorPipeline

dali/test/python/operator_2/test_python_function.py:86–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84
85
86class PythonOperatorPipeline(CommonPipeline):
87 def __init__(
88 self, batch_size, num_threads, device_id, seed, image_dir, function, prefetch_queue_depth=2
89 ):
90 super().__init__(
91 batch_size,
92 num_threads,
93 device_id,
94 seed,
95 image_dir,
96 prefetch_queue_depth=prefetch_queue_depth,
97 )
98 self.python_function = ops.PythonFunction(function=function)
99
100 def define_graph(self):
101 images, labels = self.load()
102 processed = self.python_function(images)
103 assert isinstance(processed, _DataNode)
104 return processed
105
106
107class FlippingPipeline(CommonPipeline):

Callers 6

run_caseFunction · 0.70

Calls

no outgoing calls

Tested by 6

run_caseFunction · 0.56