@@ -135,13 +135,15 @@ def _get_waveform_and_window_properties(waveform: Tensor,
135135 r"""Gets the waveform and window properties
136136 """
137137 channel = max (channel , 0 )
138- assert channel < waveform .size (0 ), ('Invalid channel %d for size %d' % (channel , waveform .size (0 )))
138+ assert channel < waveform .size (0 ), ('Invalid channel {} for size {}' . format (channel , waveform .size (0 )))
139139 waveform = waveform [channel , :] # size (n)
140140 window_shift = int (sample_frequency * frame_shift * MILLISECONDS_TO_SECONDS )
141141 window_size = int (sample_frequency * frame_length * MILLISECONDS_TO_SECONDS )
142142 padded_window_size = _next_power_of_2 (window_size ) if round_to_power_of_two else window_size
143143
144- assert 2 <= window_size <= len (waveform ), ('choose a window size %d that is [2, %d]' % (window_size , len (waveform )))
144+ assert 2 <= window_size <= len (
145+ waveform ), ('choose a window size {} that is [2, {}]'
146+ .format (window_size , len (waveform )))
145147 assert 0 < window_shift , '`window_shift` must be greater than 0'
146148 assert padded_window_size % 2 == 0 , 'the padded `window_size` must be divisible by two.' \
147149 ' use `round_to_power_of_two` or change `frame_length`'
@@ -430,7 +432,7 @@ def get_mel_banks(num_bins: int,
430432 high_freq += nyquist
431433
432434 assert (0.0 <= low_freq < nyquist ) and (0.0 < high_freq <= nyquist ) and (low_freq < high_freq ), \
433- ('Bad values in options: low-freq %f and high-freq %f vs. nyquist %f' % (low_freq , high_freq , nyquist ))
435+ ('Bad values in options: low-freq {} and high-freq {} vs. nyquist {}' . format (low_freq , high_freq , nyquist ))
434436
435437 # fft-bin width [think of it as Nyquist-freq / half-window-length]
436438 fft_bin_width = sample_freq / window_length_padded
@@ -446,8 +448,8 @@ def get_mel_banks(num_bins: int,
446448
447449 assert vtln_warp_factor == 1.0 or ((low_freq < vtln_low < high_freq ) and
448450 (0.0 < vtln_high < high_freq ) and (vtln_low < vtln_high )), \
449- ('Bad values in options: vtln-low %f and vtln-high %f , versus low-freq %f and high-freq %f' %
450- (vtln_low , vtln_high , low_freq , high_freq ))
451+ ('Bad values in options: vtln-low {} and vtln-high {} , versus '
452+ 'low-freq {} and high-freq {}' . format (vtln_low , vtln_high , low_freq , high_freq ))
451453
452454 bin = torch .arange (num_bins ).unsqueeze (1 )
453455 left_mel = mel_low_freq + bin * mel_freq_delta # size(num_bins, 1)
0 commit comments