model_stretch2d: Stretch2d

model_stretch2dR Documentation

Stretch2d

Description

Upscale the frequency and time dimensions of a spectrogram. Pass the input through the Stretch2d layer.

Usage

model_stretch2d(time_scale, freq_scale)

Arguments

time_scale

the scale factor in time dimension

freq_scale

the scale factor in frequency dimension

Details

forward param: specgram (Tensor): the input sequence to the Stretch2d layer (..., n_freq, n_time).

Value

Tensor shape: (..., n_freq * freq_scale, n_time * time_scale)

Examples

if(torch::torch_is_installed()) {
 stretch2d = model_stretch2d(time_scale=10, freq_scale=5)

 input = torch::torch_rand(10, 100, 512)  # a random spectrogram
 output = stretch2d(input)  # shape: (10, 500, 5120)
}


curso-r/torchaudio documentation built on Aug. 6, 2022, 2:28 a.m.