-
Notifications
You must be signed in to change notification settings - Fork 24.7k
istft: require complex input #86628
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
istft: require complex input #86628
Conversation
For `stft` this makes all cases where `return_complex` default to `False` into an error and adds a warning when `return_complex=False` is passed explicitly. For `istft` this raises an error if the input is not a complex tensor. [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/86628
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Merge Blocking SEVsThere is 1 active merge blocking SEVs. Please view them below:
If you must merge, use ✅ No Failures, 1 PendingAs of commit bdbad36: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Real dtype input to `torch.istft` has been deprecated since PyTorch 1.8, so it is more than passed its due date to be removed. BC-breaking note: `torch.istft` no longer supports input in the form of real tensors with shape `(..., 2)` to mimic complex tensors. Instead, convert inputs to a complex tensor first before calling `torch.istft`. [ghstack-poisoned]
Real dtype input to `torch.istft` has been deprecated since PyTorch 1.8, so it is more than passed its due date to be removed. BC-breaking note: `torch.istft` no longer supports input in the form of real tensors with shape `(..., 2)` to mimic complex tensors. Instead, convert inputs to a complex tensor first before calling `torch.istft`. ghstack-source-id: 0970c2e Pull Request resolved: #86628
Real dtype input to `torch.istft` has been deprecated since PyTorch 1.8, so it is more than passed its due date to be removed. BC-breaking message: `torch.istft` no longer supports input in the form of real tensors with shape `(..., 2)` to mimic complex tensors. Instead, convert inputs to a complex tensor first before calling `torch.istft`. [ghstack-poisoned]
Real dtype input to `torch.istft` has been deprecated since PyTorch 1.8, so it is more than passed its due date to be removed. BC-breaking message: `torch.istft` no longer supports input in the form of real tensors with shape `(..., 2)` to mimic complex tensors. Instead, convert inputs to a complex tensor first before calling `torch.istft`. [ghstack-poisoned]
Real dtype input to `torch.istft` has been deprecated since PyTorch 1.8, so it is more than passed its due date to be removed. BC-breaking note: `torch.istft` no longer supports input in the form of real tensors with shape `(..., 2)` to mimic complex tensors. Instead, convert inputs to a complex tensor first before calling `torch.istft`. ghstack-source-id: b0e8dfe Pull Request resolved: #86628
test/test_spectral_ops.py
Outdated
@@ -44,6 +44,14 @@ | |||
not has_scipy_fft or LooseVersion(scipy.__version__) >= '1.6.0') | |||
else (None, "ortho")) | |||
|
|||
def _complex_from_float_dtype(real_dtype): |
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.
Let's use this function:
pytorch/torch/_prims_common/__init__.py
Line 773 in c27a517
def corresponding_complex_dtype(dtype: torch.dtype) -> torch.dtype: |
torch/functional.py
Outdated
where the ``channel`` dimension is optional. | ||
|
||
.. versionchanged:: 1.14.0 | ||
Real input is no longer supported. Input must be complex, as returned by |
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.
"Real-valued inputs are no longer supported. Input must now have a complex datatype, ..."
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.
Cool! A couple small nits inline for your review
Real dtype input to `torch.istft` has been deprecated since PyTorch 1.8, so it is more than passed its due date to be removed. BC-breaking note: `torch.istft` no longer supports input in the form of real tensors with shape `(..., 2)` to mimic complex tensors. Instead, convert inputs to a complex tensor first before calling `torch.istft`. ghstack-source-id: b0e8dfe Pull Request resolved: pytorch#86628
Real dtype input to `torch.istft` has been deprecated since PyTorch 1.8, so it is more than passed its due date to be removed. BC-breaking message: `torch.istft` no longer supports input in the form of real tensors with shape `(..., 2)` to mimic complex tensors. Instead, convert inputs to a complex tensor first before calling `torch.istft`. [ghstack-poisoned]
Real dtype input to `torch.istft` has been deprecated since PyTorch 1.8, so it is more than passed its due date to be removed. BC-breaking note: `torch.istft` no longer supports input in the form of real tensors with shape `(..., 2)` to mimic complex tensors. Instead, convert inputs to a complex tensor first before calling `torch.istft`. ghstack-source-id: 90d6773 Pull Request resolved: #86628
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Stack from ghstack (oldest at bottom):
Real dtype input to
torch.istft
has been deprecated since PyTorch1.8, so it is more than passed its due date to be removed.
BC-breaking message:
torch.istft
no longer supports input in the form of real tensorswith shape
(..., 2)
to mimic complex tensors. Instead, convertinputs to a complex tensor first before calling
torch.istft
.1.13
2.0