mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 13:44:15 +08:00
Revert "[BE] typing for decorators - signal/windows/windows (#131582)"
This reverts commit 8689d377f9b60b70efa6608e654a3889f947f4d8. Reverted https://github.com/pytorch/pytorch/pull/131582 on behalf of https://github.com/clee2000 due to breaking lint internally D60265575 ([comment](https://github.com/pytorch/pytorch/pull/131572#issuecomment-2254328359))
This commit is contained in:
@ -1,5 +1,6 @@
|
|||||||
|
# mypy: allow-untyped-decorators
|
||||||
# mypy: allow-untyped-defs
|
# mypy: allow-untyped-defs
|
||||||
from typing import Optional, Iterable, TypeVar, Callable
|
from typing import Optional, Iterable
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
from math import sqrt
|
from math import sqrt
|
||||||
@ -21,8 +22,6 @@ __all__ = [
|
|||||||
'nuttall',
|
'nuttall',
|
||||||
]
|
]
|
||||||
|
|
||||||
_T = TypeVar("_T")
|
|
||||||
|
|
||||||
window_common_args = merge_dicts(
|
window_common_args = merge_dicts(
|
||||||
parse_kwargs(
|
parse_kwargs(
|
||||||
"""
|
"""
|
||||||
@ -40,7 +39,7 @@ window_common_args = merge_dicts(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def _add_docstr(*args: str) -> Callable[[_T], _T]:
|
def _add_docstr(*args):
|
||||||
r"""Adds docstrings to a given decorated function.
|
r"""Adds docstrings to a given decorated function.
|
||||||
|
|
||||||
Specially useful when then docstrings needs string interpolation, e.g., with
|
Specially useful when then docstrings needs string interpolation, e.g., with
|
||||||
@ -52,7 +51,7 @@ def _add_docstr(*args: str) -> Callable[[_T], _T]:
|
|||||||
args (str):
|
args (str):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def decorator(o: _T) -> _T:
|
def decorator(o):
|
||||||
o.__doc__ = "".join(args)
|
o.__doc__ = "".join(args)
|
||||||
return o
|
return o
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user