Skip to content

Commit 5bb9243

Browse files
committed
Update docstrings and errors
1 parent 6cd2592 commit 5bb9243

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

torch/signal/windows/windows.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def _window_function_checks(function_name: str, M: int, dtype: torch.dtype, layo
4242
layout (:class:`torch.layout`): the desired layout of the window tensor.
4343
"""
4444
if M < 0:
45-
raise ValueError(f'{function_name} requires non-negative window_length, got window_length={M}')
45+
raise ValueError(f'{function_name} requires non-negative window length, got M={M}')
4646
if layout is not torch.strided:
4747
raise ValueError(f'{function_name} is implemented for strided tensors only, got: {layout}')
4848
if not is_float_dtype(dtype):
@@ -66,7 +66,7 @@ def _window_function_checks(function_name: str, M: int, dtype: torch.dtype, layo
6666
In other words, the number of points of the exponential window.
6767
center (float, optional): where the center of the window will be located.
6868
In other words, at which sample the peak of the window can be found.
69-
Default: `window_length / 2` if `periodic` is `True` (default), else `(window_length - 1) / 2`.
69+
Default: `M / 2` if `sym` is `False`, else `(M - 1) / 2`.
7070
tau (float, optional): the decay value. Default: 1.0.
7171
sym (bool, optional): If `False`, returns a periodic window suitable for use in spectral analysis.
7272
If `True`, returns a symmetric window suitable for use in filter design. Default: `True`.

torch/testing/_internal/opinfo/definitions/signal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def error_inputs_window(op_info, device, *args, **kwargs):
5757
yield ErrorInput(
5858
SampleInput(-1, *args, dtype=torch.float32, device=device, **kwargs),
5959
error_type=ValueError,
60-
error_regex="requires non-negative window_length, got window_length=-1",
60+
error_regex="requires non-negative window length, got M=-1",
6161
)
6262

6363
# Tests for window tensors that are not torch.strided, for instance, torch.sparse_coo.

0 commit comments

Comments
 (0)