mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
[BE] Enable Ruff's Flake8 PYI030 (#111103)
Enable [unnecessary-literal-union (PYI030)](https://docs.astral.sh/ruff/rules/unnecessary-literal-union/) Link: #110950 Pull Request resolved: https://github.com/pytorch/pytorch/pull/111103 Approved by: https://github.com/albanD
This commit is contained in:
parent
68a1219f74
commit
2f53085f3f
|
|
@ -50,7 +50,6 @@ ignore = [
|
|||
"PYI018",
|
||||
"PYI019",
|
||||
"PYI024",
|
||||
"PYI030",
|
||||
"PYI034",
|
||||
"PYI036",
|
||||
"PYI041",
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ __all__ = [
|
|||
"ifftshift",
|
||||
]
|
||||
|
||||
NormType = Union[None, Literal["forward"], Literal["backward"], Literal["ortho"]]
|
||||
NormType = Union[None, Literal["forward", "backward", "ortho"]]
|
||||
_NORM_VALUES = {None, "forward", "backward", "ortho"}
|
||||
aten = torch._ops.ops.aten
|
||||
|
||||
|
|
|
|||
|
|
@ -222,11 +222,11 @@ def gen_registration_helpers(backend_index: BackendIndex) -> List[str]:
|
|||
class RegisterDispatchKey:
|
||||
backend_index: BackendIndex
|
||||
|
||||
target: Union[
|
||||
Literal[Target.ANONYMOUS_DEFINITION],
|
||||
Literal[Target.NAMESPACED_DEFINITION],
|
||||
Literal[Target.NAMESPACED_DECLARATION],
|
||||
Literal[Target.REGISTRATION],
|
||||
target: Literal[
|
||||
Target.ANONYMOUS_DEFINITION,
|
||||
Target.NAMESPACED_DEFINITION,
|
||||
Target.NAMESPACED_DECLARATION,
|
||||
Target.REGISTRATION,
|
||||
]
|
||||
|
||||
# Selector object to determine which operators to generate
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user