mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Revert "[BE] typing for decorators - signal/windows/windows (#131582)"
This reverts commit 8689d377f9.
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:
parent
d90f6b45c0
commit
e448f32944
|
|
@ -1,5 +1,6 @@
|
|||
# mypy: allow-untyped-decorators
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Optional, Iterable, TypeVar, Callable
|
||||
from typing import Optional, Iterable
|
||||
|
||||
import torch
|
||||
from math import sqrt
|
||||
|
|
@ -21,8 +22,6 @@ __all__ = [
|
|||
'nuttall',
|
||||
]
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
window_common_args = merge_dicts(
|
||||
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.
|
||||
|
||||
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):
|
||||
"""
|
||||
|
||||
def decorator(o: _T) -> _T:
|
||||
def decorator(o):
|
||||
o.__doc__ = "".join(args)
|
||||
return o
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user