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

Method __init__

dali/test/python/operator_2/test_reshape.py:32–51  ·  view source on GitHub ↗
(
        self, device, batch_size, relative, use_wildcard, num_threads=3, device_id=0, num_gpus=1
    )

Source from the content-addressed store, hash-verified

30
31class ReshapePipeline(Pipeline):
32 def __init__(
33 self, device, batch_size, relative, use_wildcard, num_threads=3, device_id=0, num_gpus=1
34 ):
35 super(ReshapePipeline, self).__init__(
36 batch_size, num_threads, device_id, seed=7865, exec_async=True, exec_pipelined=True
37 )
38 self.device = device
39 self.input = ops.readers.Caffe(
40 path=caffe_db_folder, shard_id=device_id, num_shards=num_gpus
41 )
42 self.decode = ops.decoders.Image(device="cpu", output_type=types.RGB)
43 W = 320
44 H = 224
45 self.resize = ops.Resize(device="cpu", resize_x=W, resize_y=H)
46 WC = -1 if use_wildcard else W * 3
47 if relative:
48 rel_shape = (-1, 3) if use_wildcard else (1, 3)
49 self.reshape = ops.Reshape(device=device, rel_shape=rel_shape, layout="ab")
50 else:
51 self.reshape = ops.Reshape(device=device, shape=(H, WC), layout="ab")
52
53 def define_graph(self):
54 jpegs, labels = self.input(name="Reader")

Callers 4

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 2

ResizeMethod · 0.45
ReshapeMethod · 0.45

Tested by

no test coverage detected