-
Notifications
You must be signed in to change notification settings - Fork 732
[BC-Breaking] Drop pseudo complex support from phase_vocoder / TimeStretch #1957
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
[BC-Breaking] Drop pseudo complex support from phase_vocoder / TimeStretch #1957
Conversation
85c56eb to
6093387
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| complex_specgrams = torch.view_as_complex(complex_specgrams) | ||
|
|
||
| # pack batch | ||
| shape = complex_specgrams.size() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The complex_specgrams can be renamed as specgram since the dtype of it is always complex, but that is BC-Breaking, maybe it's fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, unfortunately, it is BC-breaking and we do not have a strong reason to push the BC-breaking here.
| hop_length = 512 | ||
| fixed_rate = 1.3 | ||
| tensor = torch.view_as_complex(torch.rand((10, 2, n_freq, 10, 2))) | ||
| tensor = torch.rand((10, 2, n_freq, 10), dtype=torch.cfloat) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you change it by using the get_spectrogram method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Using get_specgrogram first time in a while and now I feel it's not user-friendly...
| num_frames = 400 | ||
| batch = 3 | ||
|
|
||
| spec = torch.randn(batch, num_freq, num_frames, dtype=torch.complex64) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
| T.TimeStretch(n_freq=n_freq, hop_length=hop_length, fixed_rate=fixed_rate), | ||
| tensor, | ||
| test_pseudo_complex | ||
| False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is False by default, so we could also just remove the parameter here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the option from the helper function as it is no longer necessary.
6093387 to
8d8feab
Compare
8d8feab to
8cf40ef
Compare
Following the plan #1337, this PR drops the support for pseudo complex type from
F.phase_vocoderandT.TimeStretch.