Skip to content

Commit b76c98c

Browse files
author
Feiyu Chan
authored
fix typos and clean code (#39)
* fix invisible character in mkl branch and fix error in error message * clean code: remove docstring from unittest for signal.py.
1 parent a4abc4e commit b76c98c

File tree

2 files changed

+2
-51
lines changed

2 files changed

+2
-51
lines changed

paddle/fluid/operators/spectral_op.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ static inline void MKL_DFTI_CHECK(MKL_INT status) {
356356
struct DftiDescriptorDeleter {
357357
void operator()(DFTI_DESCRIPTOR_HANDLE handle) {
358358
if (handle != nullptr) {
359-
MKL_DFTI_CHECK(platform::errors::External(DftiFreeDescriptor(&handle)));
359+
MKL_DFTI_CHECK(DftiFreeDescriptor(&handle));
360360
}
361361
}
362362
};
@@ -409,7 +409,7 @@ DftiDescriptor _plan_mkl_fft(const framework::proto::VarType::Type& in_dtype,
409409
case framework::proto::VarType::COMPLEX128:
410410
return DFTI_DOUBLE;
411411
default:
412-
PADDLE_THROW(platform::errors::InvalidArgument(
412+
PADDLE_THROW(platform::errors::InvalidArgument(
413413
"Input data type should be FP32, FP64, COMPLEX64 or COMPLEX128."));
414414
}
415415
}();

python/paddle/fluid/tests/unittests/test_signal.py

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -153,55 +153,6 @@ def window_sumsquare(
153153
n_fft=2048,
154154
dtype=np.float32,
155155
norm=None, ):
156-
"""Compute the sum-square envelope of a window function at a given hop length.
157-
158-
This is used to estimate modulation effects induced by windowing observations
159-
in short-time Fourier transforms.
160-
161-
Parameters
162-
----------
163-
window : string, tuple, number, callable, or list-like
164-
Window specification, as in `get_window`
165-
166-
n_frames : int > 0
167-
The number of analysis frames
168-
169-
hop_length : int > 0
170-
The number of samples to advance between frames
171-
172-
win_length : [optional]
173-
The length of the window function. By default, this matches ``n_fft``.
174-
175-
n_fft : int > 0
176-
The length of each analysis frame.
177-
178-
dtype : np.dtype
179-
The data type of the output
180-
181-
Returns
182-
-------
183-
wss : np.ndarray, shape=``(n_fft + hop_length * (n_frames - 1))``
184-
The sum-squared envelope of the window function
185-
186-
Examples
187-
--------
188-
For a fixed frame length (2048), compare modulation effects for a Hann window
189-
at different hop lengths:
190-
191-
>>> n_frames = 50
192-
>>> wss_256 = librosa.filters.window_sumsquare('hann', n_frames, hop_length=256)
193-
>>> wss_512 = librosa.filters.window_sumsquare('hann', n_frames, hop_length=512)
194-
>>> wss_1024 = librosa.filters.window_sumsquare('hann', n_frames, hop_length=1024)
195-
196-
>>> import matplotlib.pyplot as plt
197-
>>> fig, ax = plt.subplots(nrows=3, sharey=True)
198-
>>> ax[0].plot(wss_256)
199-
>>> ax[0].set(title='hop_length=256')
200-
>>> ax[1].plot(wss_512)
201-
>>> ax[1].set(title='hop_length=512')
202-
>>> ax[2].plot(wss_1024)
203-
>>> ax[2].set(title='hop_length=1024')
204-
"""
205156
if win_length is None:
206157
win_length = n_fft
207158

0 commit comments

Comments
 (0)