Revert "[BE] typing for decorators - _inductor/fx_passes/post_grad (#131575)"
This reverts commit 42dc5a47a157f9a441ceba53cf569cc42a640732.
Reverted https://github.com/pytorch/pytorch/pull/131575 on behalf of https://github.com/clee2000 due to breaking lint internally D60265575 ([comment](https://github.com/pytorch/pytorch/pull/131572#issuecomment-2254328359))
diff --git a/torch/_inductor/fx_passes/post_grad.py b/torch/_inductor/fx_passes/post_grad.py
index c9a7f43..956a0a4 100644
--- a/torch/_inductor/fx_passes/post_grad.py
+++ b/torch/_inductor/fx_passes/post_grad.py
@@ -5,18 +5,7 @@
import logging
import operator
from collections import Counter, defaultdict
-from typing import (
- Any,
- Callable,
- Dict,
- List,
- Optional,
- Set,
- TYPE_CHECKING,
- TypeVar,
- Union,
-)
-from typing_extensions import ParamSpec
+from typing import Any, Dict, List, Optional, Set, TYPE_CHECKING, Union
import torch
import torch._inductor as inductor
@@ -67,8 +56,6 @@
if TYPE_CHECKING:
from sympy import Expr
-_T = TypeVar("_T")
-_P = ParamSpec("_P")
log = logging.getLogger(__name__)
aten = torch.ops.aten
@@ -202,9 +189,7 @@
torch.fx.map_arg((node.args, node.kwargs), visit)
-def register_lowering_pattern(
- pattern, extra_check=_return_true, pass_number=1
-) -> Callable[[Callable[_P, _T]], Callable[_P, _T]]:
+def register_lowering_pattern(pattern, extra_check=_return_true, pass_number=1):
"""
Register an aten to inductor IR replacement pattern
"""