Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cherry-picked 0.9] Update MelSpectrogram power annotation #1572

Merged
merged 2 commits into from Jun 14, 2021

Conversation

mthrok
Copy link
Collaborator

@mthrok mthrok commented Jun 13, 2021

Resolves #1570

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, MelSpectrogram fails because of extra dimension (when using pseudo complex) or type mismatch between float and cfloat (when using native complex).

This PR changes type annotation so that power is only float.

@carolineechen Can you review? I think we can cherry-pick this to 0.9. Aldo Do you think this should be labeled BC-breaking? power=None never worked, so it does not break anything.

@mthrok mthrok merged commit c5d0390 into pytorch:master Jun 14, 2021
@mthrok mthrok deleted the melspec-annotation branch June 14, 2021 12:42
mthrok added a commit to mthrok/audio that referenced this pull request Jun 14, 2021
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.
@mthrok mthrok changed the title Update MelSpectrogram power annotation [Cherry-picked 0.9.0] Update MelSpectrogram power annotation Jun 14, 2021
@mthrok mthrok changed the title [Cherry-picked 0.9.0] Update MelSpectrogram power annotation [Cherry-picked 0.9] Update MelSpectrogram power annotation Jun 14, 2021
mthrok pushed a commit to mthrok/audio that referenced this pull request Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using MelSpec when power=None
3 participants