mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Flip default value for mypy disallow_untyped_defs [7/11] (#127844)
See #127836 for details. Pull Request resolved: https://github.com/pytorch/pytorch/pull/127844 Approved by: https://github.com/oulgen ghstack dependencies: #127842, #127843
This commit is contained in:
committed by
PyTorch MergeBot
parent
7c12cc7ce4
commit
038b927590
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import copy
|
||||
import dataclasses
|
||||
import functools
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import dataclasses
|
||||
from enum import auto, Enum
|
||||
from typing import Collection, Dict, List, Mapping, Optional, Set, Tuple, Union
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import abc
|
||||
import copy
|
||||
import operator
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import (
|
||||
List, Tuple, Optional, Union, Any, Sequence, TYPE_CHECKING
|
||||
)
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import cast, Callable, Generic, List, Optional, Type, TypeVar, Union
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Any, Dict
|
||||
import textwrap
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from contextlib import contextmanager
|
||||
|
||||
from torch.fx import GraphModule
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from collections import namedtuple
|
||||
from typing import Any, Callable, Dict, List, NamedTuple, Optional, Tuple, Type
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import builtins
|
||||
import copy
|
||||
import functools
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Dict, Optional
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from torch.fx.proxy import Proxy
|
||||
from ._compatibility import compatibility
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import List, Optional, Type
|
||||
|
||||
__all__ = ["SymDispatchMode", "handle_sym_dispatch", "sym_function_mode"]
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import operator
|
||||
from collections import deque
|
||||
from typing import Dict, List, Set, NamedTuple, Tuple, Deque
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import re
|
||||
from typing import Callable, Dict, Optional, Set, Union
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch.fx as fx
|
||||
|
||||
def set_trace(gm: fx.GraphModule) -> fx.GraphModule:
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from functools import reduce
|
||||
import torch
|
||||
import operator
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
|
||||
from torch.fx.node import Node
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
import torch.fx
|
||||
import warnings
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from torch.fx.experimental.migrate_gradual_types.operation import op_add, op_sub, op_mul, op_div, \
|
||||
op_mod, op_gt, op_lt, op_neq, op_eq
|
||||
from torch.fx.tensor_type import TensorType, Dyn
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
import operator
|
||||
import warnings
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from torch.fx.experimental.migrate_gradual_types.constraint import Conj, Disj, T, F, BinConstraintT, BVar, is_bool_expr
|
||||
from torch.fx.experimental.migrate_gradual_types.constraint import BinConstraintD, TVar, DVar
|
||||
from torch.fx.experimental.migrate_gradual_types.constraint import Prod, is_algebraic_expression, is_dim
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from torch.fx.experimental.migrate_gradual_types.constraint import TVar, DVar, BinConstraintD, \
|
||||
BVar
|
||||
from torch.fx.experimental.migrate_gradual_types.operation import op_leq
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import operator
|
||||
from typing import Any, Callable, Dict, Tuple, Optional
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch.fx as fx
|
||||
from torch.fx.node import Argument, Target
|
||||
from torch.nn.utils.fusion import fuse_conv_bn_eval
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from enum import Enum
|
||||
from typing import NamedTuple, Dict, List, Set
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import functools
|
||||
import inspect
|
||||
import itertools
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
class Equality:
|
||||
def __init__(self, lhs, rhs):
|
||||
self.lhs = lhs
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import ast
|
||||
import inspect
|
||||
import textwrap
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
import torch.fx
|
||||
import inspect
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import copy
|
||||
from collections import defaultdict
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""
|
||||
This file does three things:
|
||||
- Contains the definition of SymNode
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from collections.abc import Iterator # type: ignore[import]
|
||||
from functools import partial
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from .core import unify, reify # type: ignore[attr-defined]
|
||||
from .variable import isvar
|
||||
from .utils import _toposort, freeze
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from .core import unify, reify # type: ignore[attr-defined]
|
||||
from .dispatch import dispatch
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from .utils import _toposort, groupby
|
||||
from .variadic import isvariadic
|
||||
import operator
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import inspect
|
||||
import sys
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from warnings import warn
|
||||
import inspect
|
||||
from typing_extensions import deprecated
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from collections import OrderedDict
|
||||
|
||||
__all__ = ["raises", "expand_tuples", "reverse_dict", "groupby", "typename"]
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from .utils import typename
|
||||
|
||||
__all__ = ["VariadicSignatureType", "isvariadic", "VariadicSignatureMeta", "Variadic"]
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import collections
|
||||
import operator
|
||||
from functools import reduce
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
__all__ = ["hashable", "transitive_get", "raises", "reverse_dict", "xfail", "freeze"]
|
||||
def hashable(x):
|
||||
try:
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from contextlib import contextmanager
|
||||
from .utils import hashable
|
||||
from .dispatch import dispatch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from torch.fx.experimental.graph_gradual_typechecker import Refine
|
||||
from torch.fx.tensor_type import TensorType
|
||||
from torch.fx.experimental.unification import Var, unify # type: ignore[attr-defined]
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import functools
|
||||
import logging
|
||||
import math
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from collections import defaultdict
|
||||
from .node import Node, Argument, Target, map_arg, _type_repr, _get_qualified_name
|
||||
import torch.utils._pytree as pytree
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import contextlib
|
||||
import copy
|
||||
import itertools
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Any, Dict, Iterable, List, Tuple
|
||||
|
||||
from torch.utils._pytree import (
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from .graph_module import GraphModule
|
||||
from ._lazy_graph_module import _make_graph_module
|
||||
from .graph import Graph
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
import inspect
|
||||
import numbers
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
from torch.fx.passes.infra.partitioner import CapabilityBasedPartitioner
|
||||
from torch.fx.passes.operator_support import OperatorSupport
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Dict, Tuple, Any
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Optional
|
||||
|
||||
import torch.fx
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
|
||||
import hashlib
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Any, Dict, List, NamedTuple, Optional
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import os
|
||||
from typing import Optional
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from torch.fx.passes.utils.fuser_utils import fuse_by_partitions
|
||||
import collections
|
||||
import itertools
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import abc
|
||||
from collections import namedtuple
|
||||
from typing import Optional
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import inspect
|
||||
import logging
|
||||
from queue import Queue
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import logging
|
||||
from dataclasses import dataclass
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import abc
|
||||
import typing as t
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from functools import wraps
|
||||
from inspect import unwrap
|
||||
from typing import Callable, List, Optional
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
from torch.fx import Node
|
||||
from torch.fx._compatibility import compatibility
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import logging
|
||||
import operator
|
||||
from typing import Any, Dict, Optional, Set, TYPE_CHECKING
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import inspect
|
||||
from typing import Any, Callable, Dict, List, Optional, Set
|
||||
from collections import OrderedDict
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import copy
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Dict, List, Optional, Tuple, Type, Union
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import argparse
|
||||
import copy
|
||||
from collections import defaultdict
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import List, Tuple, Union, Dict, Any, Set, Mapping, Optional
|
||||
import collections
|
||||
from dataclasses import dataclass
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Dict, Tuple
|
||||
|
||||
from torch.fx._compatibility import compatibility
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import copy
|
||||
from queue import SimpleQueue
|
||||
from typing import List, Dict, Tuple
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from dataclasses import dataclass, field
|
||||
from collections import defaultdict
|
||||
import copy
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from dataclasses import dataclass, field
|
||||
from torch.fx.graph import Graph
|
||||
from torch.fx.node import Node
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from torch.fx.experimental.unification import Var # type: ignore[attr-defined]
|
||||
|
||||
from ._compatibility import compatibility
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import traceback
|
||||
from contextlib import contextmanager
|
||||
from typing import List, Any, Dict
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import contextlib
|
||||
import errno
|
||||
import hashlib
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import warnings
|
||||
|
||||
from contextlib import contextmanager
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""Async API.
|
||||
|
||||
This module contains the API for parallelism in TorchScript, notably:
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
from torch._jit_internal import _Await
|
||||
from torch.jit._builtins import _register_builtin
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import cmath
|
||||
import math
|
||||
import warnings
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import ast
|
||||
import inspect
|
||||
import textwrap
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
# Functions for synthesizing magic methods for JIT-compiled dataclasses
|
||||
import ast
|
||||
import dataclasses
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
from torch._ops import OpOverload, OpOverloadPacket
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
from torch import Tensor
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""Freezing.
|
||||
|
||||
This is not intended to be imported directly; please use the exposed
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import contextlib
|
||||
from typing import List, Tuple
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Union
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import inspect
|
||||
import pathlib
|
||||
import sys
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""
|
||||
Tools to help with tensor property propagation.
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
# These functions are referenced from the pickle archives produced by
|
||||
# ScriptModule.save()
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import collections
|
||||
import functools
|
||||
import inspect
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
# mypy: disable-error-code="type-arg"
|
||||
from typing import (
|
||||
Any,
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""Serialization.
|
||||
|
||||
This module contains functionality for serializing TorchScript modules, notably:
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import math
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""JIT-related state.
|
||||
|
||||
This module stores various pieces of Python-global state relating to the JIT.
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""Tracing.
|
||||
|
||||
This module contains functionality to support the JIT's tracing frontend, notably:
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import ast
|
||||
import builtins
|
||||
import dis
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import ast
|
||||
import dataclasses
|
||||
import inspect
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import List
|
||||
|
||||
from torch._C import _compile_graph_to_code_table, _generate_upgraders_graph
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import os
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import inspect
|
||||
import textwrap
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user