@@ -73,11 +73,11 @@ def spectrogram(
73
73
onesided (bool, optional): controls whether to return half of results to
74
74
avoid redundancy. Default: ``True``
75
75
return_complex (bool, optional):
76
- ``return_complex = True``, this function returns the resulting Tensor in
77
- complex dtype, otherwise it returns the resulting Tensor in real dtype with extra
78
- dimension for real and imaginary parts. (see ``torch.view_as_real``) .
79
- When ``power`` is provided, the value must be False, as the resulting
80
- Tensor represents real-valued power .
76
+ Indicates whether the resulting complex-valued Tensor should be represented with
77
+ native complex dtype, such as `torch.cfloat` and `torch.cdouble`, or real dtype
78
+ mimicking complex value with an extra dimension for real and imaginary parts.
79
+ This argument is only effective when ``power=None``.
80
+ See also ``torch.view_as_real`` .
81
81
82
82
Returns:
83
83
Tensor: Dimension (..., freq, time), freq is
@@ -92,11 +92,6 @@ def spectrogram(
92
92
"for more details about torchaudio's plan to migrate to native complex type."
93
93
)
94
94
95
- if power is not None and return_complex :
96
- raise ValueError (
97
- 'When `power` is provided, the return value is real-valued. '
98
- 'Therefore, `return_complex` must be False.' )
99
-
100
95
if pad > 0 :
101
96
# TODO add "with torch.no_grad():" back when JIT supports it
102
97
waveform = torch .nn .functional .pad (waveform , (pad , pad ), "constant" )
0 commit comments