-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
stft: Require return_complex to be passed explicitly for real input #86724
Conversation
This behavior has been deprecated since PyTorch 1.8 but this step of the deprecation cycle was put on hold in #50102 waiting for JIT upgraders functionality which doesn't seem to have panned out. I'd say there has been more than enough of a deprecation period, so we should just continue. BC-breaking message: `torch.stft` takes an optional `return_complex` parameter that indicates whether the output should be a floating point tensor or a complex tensor. `return_complex` previously defaulted to `False` for real input tensors. This PR removes the default and makes `return_complex` a required argument for real inputs. However, complex inputs will continue to default to `return_complex=True`. [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/86724
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 792aa85: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
y = x.stft(10, pad_mode='constant') | ||
# with self.assertRaisesRegex(RuntimeError, 'stft requires the return_complex parameter'): | ||
# y = x.stft(10, pad_mode='constant') | ||
with self.assertRaisesRegex(RuntimeError, 'stft requires the return_complex parameter'): |
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.
Nit: this could be an error input
@@ -612,6 +612,15 @@ def stft(input: Tensor, n_fft: int, hop_length: Optional[int] = None, | |||
a real tensor with an extra last dimension for the real and | |||
imaginary components. | |||
|
|||
.. versionchanged:: 1.14.0 |
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.
Nice directives
torch/functional.py
Outdated
@@ -612,6 +612,15 @@ def stft(input: Tensor, n_fft: int, hop_length: Optional[int] = None, | |||
a real tensor with an extra last dimension for the real and | |||
imaginary components. | |||
|
|||
.. versionchanged:: 1.14.0 | |||
``return_complex`` is now a required argument for real inputs, | |||
as the default is being trainsitioned to ``True``. |
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.
"trainsitioned" -> "transitioned"
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 seems reasonable to me -- @ngimel @albanD is there someone at Meta who should sanity-check the BC implications?
@peterbell10 take a look at my questions about the docs, however -- I think they can be streamlined
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 think we should just land this!
Checking is so painful that it is easier to try and land it :)
If it comes back to us we can go down the rabbit hole.
This behavior has been deprecated since PyTorch 1.8 but this step of the deprecation cycle was put on hold in pytorch#50102 waiting for JIT upgraders functionality which doesn't seem to have panned out. I'd say there has been more than enough of a deprecation period, so we should just continue. BC-breaking message: `torch.stft` takes an optional `return_complex` parameter that indicates whether the output should be a floating point tensor or a complex tensor. `return_complex` previously defaulted to `False` for real input tensors. This PR removes the default and makes `return_complex` a required argument for real inputs. However, complex inputs will continue to default to `return_complex=True`. ghstack-source-id: 32da297a1ffb8c438910cfd237ad20857da5c15b Pull Request resolved: pytorch#86724
…eal input" This behavior has been deprecated since PyTorch 1.8 but this step of the deprecation cycle was put on hold in #50102 waiting for JIT upgraders functionality which doesn't seem to have panned out. I'd say there has been more than enough of a deprecation period, so we should just continue. BC-breaking message: `torch.stft` takes an optional `return_complex` parameter that indicates whether the output should be a floating point tensor or a complex tensor. `return_complex` previously defaulted to `False` for real input tensors. This PR removes the default and makes `return_complex` a required argument for real inputs. However, complex inputs will continue to default to `return_complex=True`. [ghstack-poisoned]
This behavior has been deprecated since PyTorch 1.8 but this step of the deprecation cycle was put on hold in pytorch#50102 waiting for JIT upgraders functionality which doesn't seem to have panned out. I'd say there has been more than enough of a deprecation period, so we should just continue. BC-breaking message: `torch.stft` takes an optional `return_complex` parameter that indicates whether the output should be a floating point tensor or a complex tensor. `return_complex` previously defaulted to `False` for real input tensors. This PR removes the default and makes `return_complex` a required argument for real inputs. However, complex inputs will continue to default to `return_complex=True`. ghstack-source-id: 32da297a1ffb8c438910cfd237ad20857da5c15b Pull Request resolved: pytorch#86724
…eal input" This behavior has been deprecated since PyTorch 1.8 but this step of the deprecation cycle was put on hold in #50102 waiting for JIT upgraders functionality which doesn't seem to have panned out. I'd say there has been more than enough of a deprecation period, so we should just continue. BC-breaking message: `torch.stft` takes an optional `return_complex` parameter that indicates whether the output should be a floating point tensor or a complex tensor. `return_complex` previously defaulted to `False` for real input tensors. This PR removes the default and makes `return_complex` a required argument for real inputs. However, complex inputs will continue to default to `return_complex=True`. [ghstack-poisoned]
@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 |
This behavior has been deprecated since PyTorch 1.8 but this step of the deprecation cycle was put on hold in pytorch#50102 waiting for JIT upgraders functionality which doesn't seem to have panned out. I'd say there has been more than enough of a deprecation period, so we should just continue. BC-breaking message: `torch.stft` takes an optional `return_complex` parameter that indicates whether the output should be a floating point tensor or a complex tensor. `return_complex` previously defaulted to `False` for real input tensors. This PR removes the default and makes `return_complex` a required argument for real inputs. However, complex inputs will continue to default to `return_complex=True`. ghstack-source-id: fba3d911016009d7e68e053eba01f4d3bf053f1f Pull Request resolved: pytorch#86724
Stack from ghstack (oldest at bottom):
This behavior has been deprecated since PyTorch 1.8 but this step of
the deprecation cycle was put on hold in #50102 waiting for JIT
upgraders functionality which doesn't seem to have panned out. I'd say
there has been more than enough of a deprecation period, so we should
just continue.
BC-breaking message:
torch.stft
takes an optionalreturn_complex
parameter thatindicates whether the output should be a floating point tensor or a
complex tensor.
return_complex
previously defaulted toFalse
forreal input tensors. This PR removes the default and makes
return_complex
a required argument for real inputs. However, complexinputs will continue to default to
return_complex=True
.1.13
2.0