Flip default value for mypy disallow_untyped_defs [1/11] (#127838)

See #127836 for details.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/127838
Approved by: https://github.com/oulgen
This commit is contained in:
Aaron Orenstein
2024-06-08 11:08:21 -07:00
committed by PyTorch MergeBot
parent 2369c719d4
commit dcfa7702c3
128 changed files with 128 additions and 0 deletions

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import argparse import argparse

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# Owner(s): ["oncall: mobile"] # Owner(s): ["oncall: mobile"]
# mypy: allow-untyped-defs
import io import io

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# Owner(s): ["oncall: mobile"] # Owner(s): ["oncall: mobile"]
# mypy: allow-untyped-defs
import io import io
import textwrap import textwrap

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
# Owner(s): ["module: complex"] # Owner(s): ["module: complex"]
import torch import torch

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
# Owner(s): ["module: unknown"] # Owner(s): ["module: unknown"]
import threading import threading

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
# Owner(s): ["module: tests"] # Owner(s): ["module: tests"]
import torch import torch

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
# Owner(s): ["module: typing"] # Owner(s): ["module: typing"]
import doctest import doctest

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
# Owner(s): ["module: typing"] # Owner(s): ["module: typing"]
from torch.testing._internal.common_utils import ( from torch.testing._internal.common_utils import (

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
# Owner(s): ["module: unknown"] # Owner(s): ["module: unknown"]
import os import os

View File

@ -1,5 +1,6 @@
# ${generated_comment} # ${generated_comment}
# mypy: disable-error-code="type-arg" # mypy: disable-error-code="type-arg"
# mypy: allow-untyped-defs
import builtins import builtins
from typing import ( from typing import (

View File

@ -1,5 +1,6 @@
# ${generated_comment} # ${generated_comment}
# mypy: disable-error-code="type-arg" # mypy: disable-error-code="type-arg"
# mypy: allow-untyped-defs
import builtins import builtins
from enum import Enum, IntEnum from enum import Enum, IntEnum

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
from enum import Enum from enum import Enum
from typing import Any, Callable, List, Optional, Set from typing import Any, Callable, List, Optional, Set

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
from typing import Any, Dict, List, Set from typing import Any, Dict, List, Set
import torch import torch

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
# mypy: disable-error-code="type-arg" # mypy: disable-error-code="type-arg"
from datetime import timedelta from datetime import timedelta
from enum import Enum from enum import Enum

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
# mypy: disable-error-code="type-arg" # mypy: disable-error-code="type-arg"
from datetime import timedelta from datetime import timedelta
from typing import Any, Dict, Generic, List, Optional, overload, Tuple, Type, TypeVar from typing import Any, Dict, Generic, List, Optional, overload, Tuple, Type, TypeVar

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import types import types
from typing import List, NewType, Optional from typing import List, NewType, Optional

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
from typing import Any, Dict, List, Optional, Union from typing import Any, Dict, List, Optional, Union
import torch import torch

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
from enum import Enum from enum import Enum
from typing import Optional, Tuple from typing import Optional, Tuple

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
from typing import List from typing import List
from torch import Tensor from torch import Tensor

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
# defined in torch/csrc/lazy/python/init.cpp # defined in torch/csrc/lazy/python/init.cpp
from typing import Any, List, Tuple from typing import Any, List, Tuple

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
# Defined in torch/csrc/cuda/shared/nvtx.cpp # Defined in torch/csrc/cuda/shared/nvtx.cpp
def rangePushA(message: str) -> int: ... def rangePushA(message: str) -> int: ...
def rangePop() -> int: ... def rangePop() -> int: ...

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
from torch._C import LiteScriptModule, ScriptModule from torch._C import LiteScriptModule, ScriptModule
def _load_mobile_module_from_file(filename: str): ... def _load_mobile_module_from_file(filename: str): ...

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import torch import torch

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
r""" r"""
The torch package contains data structures for multi-dimensional The torch package contains data structures for multi-dimensional

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import types import types
import torch._C import torch._C

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
""" """
APIs related to torch.compile which lazily import torch._dynamo to avoid APIs related to torch.compile which lazily import torch._dynamo to avoid
circular dependencies. circular dependencies.

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import torch import torch
import torch.utils._pytree as pytree import torch.utils._pytree as pytree
from collections import namedtuple from collections import namedtuple

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import weakref import weakref
import torch import torch

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import dataclasses import dataclasses
import functools import functools
import inspect import inspect

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import inspect import inspect
from torch._custom_op.impl import ( from torch._custom_op.impl import (

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import inspect import inspect
from collections import defaultdict from collections import defaultdict
from functools import wraps from functools import wraps

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import functools import functools
import numbers import numbers
import operator import operator

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import inspect import inspect
from typing import Callable, Dict, List, Optional, Tuple from typing import Callable, Dict, List, Optional, Tuple

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import functools import functools
from collections import defaultdict from collections import defaultdict
from typing import Callable, Dict from typing import Callable, Dict

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import io import io
import torch import torch

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import itertools import itertools
import unittest.mock import unittest.mock
from contextlib import contextmanager from contextlib import contextmanager

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import torch import torch
from torch._C import DispatchKey from torch._C import DispatchKey
from torch._higher_order_ops.utils import autograd_not_implemented from torch._higher_order_ops.utils import autograd_not_implemented

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import bisect import bisect
import dataclasses import dataclasses
import dis import dis

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import copy import copy
import dataclasses import dataclasses
import dis import dis

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import logging import logging
import types import types
import weakref import weakref

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
class CompilationCallbackHandler: class CompilationCallbackHandler:
def __init__(self): def __init__(self):
self.start_callbacks = [] self.start_callbacks = []

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import types import types
from .utils import ExactWeakKeyDictionary from .utils import ExactWeakKeyDictionary

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import collections import collections
import dataclasses import dataclasses
import re import re

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import contextlib import contextlib
import functools import functools
from typing import Dict, List, Optional, TYPE_CHECKING from typing import Dict, List, Optional, TYPE_CHECKING

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
# This file establishes the public comptime interface to Dynamo. # This file establishes the public comptime interface to Dynamo.
# This allows Dynamo users to execute arbitrary Python code while # This allows Dynamo users to execute arbitrary Python code while
# Dynamo is symbolically evaluating their original programs. # Dynamo is symbolically evaluating their original programs.

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import getpass import getpass
import inspect import inspect
import os import os

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import collections import collections
import cProfile import cProfile
import dis import dis

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import torch import torch
doc = """ doc = """

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import contextlib import contextlib
import threading import threading

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
# mypy: disable-error-code="method-assign" # mypy: disable-error-code="method-assign"
import copy import copy

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
# ruff: noqa: TCH004 # ruff: noqa: TCH004
from dataclasses import dataclass from dataclasses import dataclass
from typing import TYPE_CHECKING from typing import TYPE_CHECKING

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import inspect import inspect
from typing import Any, Callable, Dict, Iterable, Optional, Tuple, Type, Union from typing import Any, Callable, Dict, Iterable, Optional, Tuple, Type, Union

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
# mypy: disable-error-code="method-assign" # mypy: disable-error-code="method-assign"
""" """

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import os import os
import textwrap import textwrap
from enum import auto, Enum from enum import auto, Enum

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
# This module contains functions that *will be allowed* by dynamo # This module contains functions that *will be allowed* by dynamo
import functools import functools

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
from __future__ import annotations from __future__ import annotations
import ast import ast

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import itertools import itertools
import logging import logging

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
# mypy: disable-error-code="method-assign" # mypy: disable-error-code="method-assign"
import functools import functools

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import collections import collections
import contextlib import contextlib
import copy import copy

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import dataclasses import dataclasses
import os import os
from typing import Any, List from typing import Any, List

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import dataclasses import dataclasses
from dataclasses import field from dataclasses import field
from types import CodeType, ModuleType from types import CodeType, ModuleType

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import argparse import argparse
import copy import copy
import functools import functools

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import argparse import argparse
import copy import copy
import functools import functools

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import copy import copy
import dataclasses import dataclasses
import sys import sys

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import inspect import inspect
import warnings import warnings
from typing import Any, Dict, List, Optional, Union from typing import Any, Dict, List, Optional, Union

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import collections import collections
import dataclasses import dataclasses
import enum import enum

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import collections import collections
import collections.abc import collections.abc
import contextlib import contextlib

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import torch import torch
from torch._prims import _make_prim, RETURN_TYPE from torch._prims import _make_prim, RETURN_TYPE
from torch._subclasses import FakeTensorMode from torch._subclasses import FakeTensorMode

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import contextlib import contextlib
import importlib import importlib
import logging import logging

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import dataclasses import dataclasses
import io import io
import logging import logging

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import contextlib import contextlib
import dis import dis
import functools import functools

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import _collections_abc import _collections_abc
import _weakrefset import _weakrefset
import abc import abc

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import atexit import atexit
import collections import collections
import contextlib import contextlib

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import functools import functools
from typing import Dict from typing import Dict

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import functools import functools
import inspect import inspect
import logging import logging

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import copy import copy
import dataclasses import dataclasses
import functools import functools

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import operator import operator
from typing import Any, Dict, List, Optional, Set, Tuple, Union from typing import Any, Dict, List, Optional, Set, Tuple, Union

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import inspect import inspect
import re import re
import string import string

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import glob import glob
import importlib import importlib
from os.path import basename, dirname, isfile, join from os.path import basename, dirname, isfile, join

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import torch import torch
import torch._dynamo as torchdynamo import torch._dynamo as torchdynamo

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import torch import torch
from torch._export.db.case import export_case from torch._export.db.case import export_case

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import torch import torch
from torch._export.db.case import export_case from torch._export.db.case import export_case

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import torch import torch
from torch._export.db.case import export_case from torch._export.db.case import export_case

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import torch import torch
from torch._export.db.case import export_case from torch._export.db.case import export_case

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import torch import torch
from torch._export.db.case import export_case from torch._export.db.case import export_case

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import torch import torch
from torch._export.db.case import export_case from torch._export.db.case import export_case

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import torch import torch
from torch._export.db.case import export_case from torch._export.db.case import export_case

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import torch import torch
from torch._export.db.case import export_case from torch._export.db.case import export_case

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import torch import torch
from torch._export.db.case import export_case from torch._export.db.case import export_case

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import torch import torch
from torch._export.db.case import export_case from torch._export.db.case import export_case

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import functools import functools
import torch import torch

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import torch import torch
from torch._export.db.case import export_case from torch._export.db.case import export_case

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import torch import torch
from torch._export.db.case import export_case from torch._export.db.case import export_case

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import torch import torch
from torch._export.db.case import export_case from torch._export.db.case import export_case

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import torch import torch
from torch._export.db.case import export_case from torch._export.db.case import export_case

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import torch import torch
from torch._export.db.case import export_case from torch._export.db.case import export_case

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import torch import torch
from torch._export.db.case import export_case, SupportLevel from torch._export.db.case import export_case, SupportLevel

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import torch import torch
from torch._export.db.case import export_case from torch._export.db.case import export_case

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import torch import torch
from torch._export.db.case import export_case from torch._export.db.case import export_case

View File

@ -1,3 +1,4 @@
# mypy: allow-untyped-defs
import torch import torch
from torch._export.db.case import export_case, ExportArgs, SupportLevel from torch._export.db.case import export_case, ExportArgs, SupportLevel

Some files were not shown because too many files have changed in this diff Show More