Unverified Commit c5d0390c authored by moto's avatar moto Committed by GitHub
Browse files

Annotate MelSpectrogram power as float only (#1572)

Mel scale frequency is in general defined/used on power spectrogram and as far as we know, it is not defined for raw (complex value) spectrogram. When `power=None` (when intermediate spectrogram is complex-valued), `MelSpectrogram` fails because of extra dimension (when using pseudo complex) or type mismatch between `torch.float` and torch.cfloat` (when using native complex).

This commit changes type annotation so that power is only float.
parent 6f9c14be
......@@ -476,7 +476,7 @@ class MelSpectrogram(torch.nn.Module):
pad: int = 0,
n_mels: int = 128,
window_fn: Callable[..., Tensor] = torch.hann_window,
power: Optional[float] = 2.,
power: float = 2.,
normalized: bool = False,
wkwargs: Optional[dict] = None,
center: bool = True,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment