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

Method __init__

dali/test/python/operator_2/test_spectrogram.py:35–63  ·  view source on GitHub ↗
(
        self,
        device,
        batch_size,
        iterator,
        nfft,
        window_length,
        window_step,
        window=None,
        center=None,
        num_threads=1,
        device_id=0,
    )

Source from the content-addressed store, hash-verified

33
34class SpectrogramPipeline(Pipeline):
35 def __init__(
36 self,
37 device,
38 batch_size,
39 iterator,
40 nfft,
41 window_length,
42 window_step,
43 window=None,
44 center=None,
45 num_threads=1,
46 device_id=0,
47 ):
48 super(SpectrogramPipeline, self).__init__(batch_size, num_threads, device_id)
49 self.device = device
50 self.iterator = iterator
51 self.inputs = ops.ExternalSource()
52 window_fn = window(window_length).tolist() if window is not None else None
53 self.fft = ops.Spectrogram(
54 device=self.device,
55 nfft=nfft,
56 window_length=window_length,
57 window_step=window_step,
58 window_fn=window_fn,
59 center_windows=center,
60 power=2,
61 )
62 # randomly insert extra axis (channels?)
63 self.r = np.random.randint(-1, 2)
64
65 def define_graph(self):
66 self.data = self.inputs()

Callers 3

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 4

windowFunction · 0.85
ExternalSourceMethod · 0.80
tolistMethod · 0.80
SpectrogramMethod · 0.45

Tested by

no test coverage detected