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

Class LazyPipeline

dali/test/python/test_pipeline.py:764–782  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

762
763
764class LazyPipeline(Pipeline):
765 def __init__(self, batch_size, db_folder, lazy_type, num_threads=1, device_id=0, num_gpus=1):
766 super(LazyPipeline, self).__init__(batch_size, num_threads, device_id)
767 self.input = ops.readers.Caffe(
768 path=db_folder, shard_id=device_id, num_shards=num_gpus, lazy_init=lazy_type
769 )
770 self.decode = ops.decoders.Image(device="mixed", output_type=types.RGB)
771 self.pos_rng_x = ops.random.Uniform(range=(0.0, 1.0), seed=1234)
772 self.pos_rng_y = ops.random.Uniform(range=(0.0, 1.0), seed=5678)
773 self.crop = ops.Crop(device="gpu", crop=(224, 224))
774
775 def define_graph(self):
776 self.jpegs, self.labels = self.input()
777
778 pos_x = self.pos_rng_x()
779 pos_y = self.pos_rng_y()
780 images = self.decode(self.jpegs)
781 crop = self.crop(images, crop_pos_x=pos_x, crop_pos_y=pos_y)
782 return (crop, self.labels)
783
784
785def test_lazy_init_empty_data_path():

Callers 2

test_lazy_initFunction · 0.85

Calls

no outgoing calls

Tested by 2

test_lazy_initFunction · 0.68