mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Flip default value for mypy disallow_untyped_defs [8/11] (#127845)
See #127836 for details. Pull Request resolved: https://github.com/pytorch/pytorch/pull/127845 Approved by: https://github.com/oulgen ghstack dependencies: #127842, #127843, #127844
This commit is contained in:
committed by
PyTorch MergeBot
parent
038b927590
commit
27f9d3b0a1
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
# this is for historical pickle deserialization, it is not used otherwise
|
||||
|
||||
def _get_thnn_function_backend():
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""Functionality for Python <-> C++ frontend inter-op."""
|
||||
|
||||
from torch import nn
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""Gradient interface."""
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""This file contains utilities for initializing neural network parameters."""
|
||||
import math
|
||||
import warnings
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
import torch.distributed as dist
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import warnings
|
||||
from typing import Optional, Tuple
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Optional, Any
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from collections import OrderedDict, abc as container_abcs
|
||||
from itertools import chain, islice
|
||||
import operator
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import math
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from .module import Module
|
||||
|
||||
from typing import Tuple, Union
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
|
||||
import warnings
|
||||
from torch import Tensor
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import itertools
|
||||
from typing import Protocol, Optional, Type, Any
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import math
|
||||
from typing import Any
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from .distance import PairwiseDistance
|
||||
from .module import Module
|
||||
from .. import functional as F
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from collections import OrderedDict, namedtuple
|
||||
import itertools
|
||||
import warnings
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
import numbers
|
||||
from torch.nn.parameter import Parameter
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from .module import Module
|
||||
from .utils import _pair, _quadruple, _ntuple
|
||||
from .. import functional as F
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import math
|
||||
import warnings
|
||||
import numbers
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Optional
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import copy
|
||||
from typing import Optional, Any, Union, Callable
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from .module import Module
|
||||
from .. import functional as F
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import collections
|
||||
from itertools import repeat
|
||||
from typing import List, Dict, Any
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing_extensions import deprecated
|
||||
|
||||
from .parallel_apply import parallel_apply
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import warnings
|
||||
import torch
|
||||
from torch.cuda import nccl
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import operator
|
||||
import torch
|
||||
import warnings
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import copy
|
||||
import functools
|
||||
import inspect
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
from typing import Any, Dict, List, Optional, Sequence, Tuple, TypeVar, Union, overload
|
||||
from typing_extensions import deprecated
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import builtins
|
||||
from typing import Optional, Tuple
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import List, Callable
|
||||
import importlib
|
||||
import warnings
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
import torch.nn.functional as F
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
import torch.nn.functional as F
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
import torch.nn.functional as F
|
||||
from .expanded_weights_impl import implements_per_sample_grads
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from contextlib import contextmanager
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Optional
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from functools import reduce
|
||||
import operator
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from functools import partial
|
||||
import torch
|
||||
import torch.nn.functional as F
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
|
||||
import torch
|
||||
import torch.nn.functional as F
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
import torch.nn.functional as F
|
||||
from .expanded_weights_impl import implements_per_sample_grads
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import functools
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import functools
|
||||
from typing import Union, Iterable, List, Dict, Tuple, Optional, cast
|
||||
from typing_extensions import deprecated
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import inspect
|
||||
import torch
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from enum import Enum, auto
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
from torch.__future__ import get_swap_module_params_on_conversion
|
||||
from torch.nn.modules.container import ModuleList, ModuleDict, Module
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
r"""Pruning methods."""
|
||||
import numbers
|
||||
from abc import ABC, abstractmethod
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Any, Iterable, NamedTuple, Optional, overload, Sequence, Tuple, Union
|
||||
|
||||
from typing_extensions import Self
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""Spectral Normalization from https://arxiv.org/abs/1802.05957."""
|
||||
import torch
|
||||
from torch.nn.functional import normalize
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import contextlib
|
||||
from collections import defaultdict
|
||||
from typing import Any, Dict, Iterator, Optional, Set, Tuple, Union
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
r"""Weight Normalization from https://arxiv.org/abs/1602.07868."""
|
||||
from torch.nn.parameter import Parameter, UninitializedParameter
|
||||
from torch import _weight_norm, norm_except_dim
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from torch import _C
|
||||
from torch._C import _onnx as _C_onnx
|
||||
from torch._C._onnx import (
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""Utility for deprecating functions."""
|
||||
|
||||
import functools
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""Globals used internally by the ONNX exporter.
|
||||
|
||||
Do not use this module outside of `torch.onnx` and its tests.
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""An internal wrapper for the beartype library.
|
||||
|
||||
The module returns a no-op decorator when the beartype library is not installed.
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""Diagnostic components for TorchScript based ONNX export, i.e. `torch.onnx.export`."""
|
||||
from __future__ import annotations
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""
|
||||
GENERATED CODE - DO NOT EDIT DIRECTLY
|
||||
This file is generated by gen_diagnostics.py.
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""This file defines an additional layer of abstraction on top of the SARIF OM."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""A diagnostic context based on SARIF."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from __future__ import annotations
|
||||
|
||||
import functools
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from __future__ import ( # for onnx.ModelProto (ONNXProgram) and onnxruntime (ONNXRuntimeOptions)
|
||||
annotations,
|
||||
)
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from __future__ import annotations
|
||||
|
||||
import abc
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from __future__ import annotations
|
||||
|
||||
import dataclasses
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""A context manager that disables the decomposition of certain ops during dynamo tracing.
|
||||
|
||||
The approach is to temporarily hijack the operator callable with PT2 custom operator.
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""Dispatcher for AtenLib functions from onnx-script."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from __future__ import annotations
|
||||
|
||||
import dataclasses
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
# NOTE: This file is referenced by name at
|
||||
# /opt/pytorch/torch/_dynamo/eval_frame.py::DONT_WRAP_FILES.
|
||||
# introduced by https://github.com/pytorch/pytorch/pull/98894.
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from __future__ import annotations
|
||||
|
||||
import inspect
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from __future__ import annotations
|
||||
|
||||
import functools
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""Dispatcher for AtenLib functions from onnx-script."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""Module for handling op-level validation during exporting."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""Common utility functions for FX passes.
|
||||
|
||||
These functions should NOT be directly invoked outside of `passes` package.
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from __future__ import annotations
|
||||
|
||||
import contextlib
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from __future__ import annotations
|
||||
|
||||
import contextlib
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from __future__ import annotations
|
||||
|
||||
import abc
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Dict, List, Sequence, Tuple, Union
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
# Owner(s): ["module: onnx"]
|
||||
from __future__ import annotations
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import List, Optional, Tuple
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import copy
|
||||
import functools
|
||||
import io
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from __future__ import annotations
|
||||
|
||||
import io
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
# NOTE: This file is referenced by name at
|
||||
# /opt/pytorch/torch/_dynamo/eval_frame.py::DONT_WRAP_FILES.
|
||||
# introduced by https://github.com/pytorch/pytorch/pull/98894.
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""Utilities for converting and operating on ONNX, JIT and torch types."""
|
||||
from __future__ import annotations
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from __future__ import annotations
|
||||
|
||||
import inspect
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""Utilities for manipulating the torch.Graph object and the torchscript."""
|
||||
from __future__ import annotations
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""Utilities for manipulating the onnx and onnx-script dependencies and ONNX proto."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import dataclasses
|
||||
import importlib
|
||||
import logging
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""Module for handling symbolic function registration."""
|
||||
|
||||
import warnings
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import inspect
|
||||
from typing import Dict, List, Union
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""Utilities for converting and operating on ONNX, JIT and torch types."""
|
||||
from __future__ import annotations
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
r"""This file provides a location for operators that help exporting models via onnx.
|
||||
|
||||
E.g. `shape_as_tensor` and `reshape_from_tensor_shape`
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import importlib
|
||||
import inspect
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from __future__ import annotations
|
||||
|
||||
import functools
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from __future__ import annotations
|
||||
|
||||
import functools
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""This file exports ONNX ops for opset 11."""
|
||||
from __future__ import annotations
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from __future__ import annotations
|
||||
|
||||
import functools
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
# EDITING THIS FILE? READ THIS FIRST!
|
||||
# see Note [Edit Symbolic Files] in README.md
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""This file exports ONNX ops for opset 14.
|
||||
|
||||
Note [ONNX operators that are added/updated in opset 14]
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""This file exports ONNX ops for opset 15.
|
||||
|
||||
Note [ONNX operators that are added/updated in opset 15]
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""This file exports ONNX ops for opset 16.
|
||||
|
||||
Note [ONNX Operators that are added/updated in opset 16]
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""This file exports ONNX ops for opset 17.
|
||||
|
||||
Note [ONNX Operators that are added/updated in opset 17]
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""This file exports ONNX ops for opset 18.
|
||||
|
||||
Note [ONNX Operators that are added/updated in opset 18]
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user