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 [4/11] (#127841)
See #127836 for details. Pull Request resolved: https://github.com/pytorch/pytorch/pull/127841 Approved by: https://github.com/oulgen
This commit is contained in:
committed by
PyTorch MergeBot
parent
afe15d2d2f
commit
62bcdc0ac9
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from collections import defaultdict
|
||||
from copy import deepcopy
|
||||
from typing import Any, Optional, Dict, TYPE_CHECKING
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from torch.ao.pruning._experimental.data_sparsifier.data_norm_sparsifier import DataNormSparsifier
|
||||
from torch.ao.pruning._experimental.data_scheduler.base_data_scheduler import BaseDataScheduler
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
from torch.ao.pruning.sparsifier.utils import module_to_fqn, fqn_to_module
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Callable, Optional, Union
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from itertools import chain
|
||||
from operator import getitem
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import cast
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
from torch import nn
|
||||
from torch.nn.utils.parametrize import is_parametrized
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""
|
||||
Collection of conversion functions for linear / conv2d structured pruning
|
||||
Also contains utilities for bias propagation
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from .base_structured_sparsifier import BaseStructuredSparsifier
|
||||
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
__all__ = [
|
||||
"get_static_sparse_quantized_mapping",
|
||||
"get_dynamic_sparse_quantized_mapping",
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
|
||||
from torch.ao.pruning import BaseSparsifier
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import warnings
|
||||
|
||||
from .base_scheduler import BaseScheduler
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import warnings
|
||||
|
||||
from .base_scheduler import BaseScheduler
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import abc
|
||||
import copy
|
||||
from collections import defaultdict
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
|
||||
from . import base_sparsifier
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Any, Dict, Optional, Type
|
||||
from torch.nn.utils.parametrize import type_before_parametrizations, is_parametrized
|
||||
from itertools import chain
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from functools import reduce
|
||||
from typing import Callable, Optional, Tuple, Union
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
# flake8: noqa: F403
|
||||
|
||||
from .fake_quantize import * # noqa: F403
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
import torch.ao.nn.quantized as nnq
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
import copy
|
||||
from typing import Dict, Any
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
from torch.nn.parameter import Parameter
|
||||
from typing import List
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import copy
|
||||
import operator
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import operator
|
||||
import torch
|
||||
from torch.ao.quantization.backend_config import (
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from __future__ import annotations
|
||||
from dataclasses import dataclass
|
||||
from typing import Any, Callable, Dict, List, Optional, Type, Union, TYPE_CHECKING
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
from ._common_operator_config_utils import (
|
||||
_get_binary_op_configs,
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
import torch.ao.nn.intrinsic as nni
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
from .backend_config import (
|
||||
BackendConfig,
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Dict, Any, List, Callable, Union, Tuple, Type
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
from torch.ao.quantization.experimental.quantizer import APoTQuantizer
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Tuple
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import copy
|
||||
from typing import Any, Callable, List, Optional, Tuple, Type, Union
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
r"""
|
||||
This file contains utility functions to convert values
|
||||
using APoT nonuniform quantization methods.
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
from torch import Tensor
|
||||
from torch.ao.quantization.experimental.observer import APoTObserver
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
from torch import Tensor
|
||||
from torch.ao.quantization.experimental.quantizer import quantize_APoT, dequantize_APoT
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
import numpy as np
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""
|
||||
This module implements nonuniform observers used to collect statistics about
|
||||
the values observed during calibration (PTQ) or training (QAT).
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
from torch import Tensor
|
||||
import numpy as np
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""Implements modules used to perform fake quantization."""
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import copy
|
||||
|
||||
import torch.nn as nn
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch.nn as nn
|
||||
import torch.ao.nn.intrinsic as nni
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import math
|
||||
from typing import Optional, Tuple
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import warnings
|
||||
|
||||
from collections import namedtuple
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
from torch.fx import map_arg, Node
|
||||
from torch.fx.graph import Graph
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Any, Dict, Set, Tuple, Callable, List
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Any, Dict, Set, Tuple, Callable
|
||||
from collections import OrderedDict
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
from torch.ao.quantization.observer import ObserverBase
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
from typing import Any, Set, Dict, List, Tuple, OrderedDict
|
||||
from collections import OrderedDict as OrdDict
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from __future__ import annotations
|
||||
from dataclasses import dataclass
|
||||
from typing import Any, Dict, List, Optional, Tuple, Type
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from torch.fx import (
|
||||
GraphModule,
|
||||
Node,
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
from torch.ao.quantization.backend_config import BackendConfig
|
||||
from torch.fx.graph import Node, Graph
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
import copy
|
||||
from torch.fx import GraphModule
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import sys
|
||||
import torch
|
||||
from torch.fx.graph import (
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from collections import OrderedDict
|
||||
from typing import Dict, Any
|
||||
from torch.ao.quantization.utils import Pattern
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import copy
|
||||
import torch
|
||||
import warnings
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
import re
|
||||
from collections import defaultdict, OrderedDict
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from abc import ABC
|
||||
from typing import Callable, Dict, List, Optional, Type
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import copy
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""
|
||||
This module implements observers which are used to collect statistics about
|
||||
the values observed during calibration (PTQ) or training (QAT).
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import logging
|
||||
import operator
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import types
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import itertools
|
||||
from typing import Any, List, OrderedDict, Set, Optional, Callable
|
||||
import operator
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import logging
|
||||
from typing import Optional
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
from torch._subclasses import FakeTensor
|
||||
from torch.ao.quantization.fx.prepare import (
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import dataclasses
|
||||
import itertools
|
||||
import operator
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
from torch.fx import GraphModule
|
||||
from ..export_utils import _WrapperModule
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import operator
|
||||
import types
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from collections import namedtuple
|
||||
from typing import Optional, Any, Union, Type
|
||||
from typing_extensions import deprecated
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from __future__ import annotations
|
||||
from collections import OrderedDict
|
||||
from typing import Any, Callable, Dict, Tuple, Union, List
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import copy
|
||||
import itertools
|
||||
import warnings
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
|
||||
import torch
|
||||
from torch.ao.quantization.qconfig import QConfig
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from __future__ import annotations
|
||||
|
||||
import copy
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from abc import ABC, abstractmethod
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Callable, Dict, List, Optional, Tuple, Union
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import List
|
||||
|
||||
from torch.ao.quantization.pt2e.utils import _is_sym_size_node
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import copy
|
||||
import functools
|
||||
import itertools
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from __future__ import annotations
|
||||
|
||||
import copy
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import itertools
|
||||
import operator
|
||||
from dataclasses import dataclass
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
|
||||
from torch import nn
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""
|
||||
Utils shared by different modes of quantization (eager/graph)
|
||||
"""
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""
|
||||
``torch.autograd`` provides classes and functions implementing automatic
|
||||
differentiation of arbitrary scalar valued functions. It requires minimal
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import operator
|
||||
from functools import reduce
|
||||
from typing_extensions import deprecated
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import operator
|
||||
from functools import reduce
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import warnings
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import os
|
||||
from collections import namedtuple
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import functools
|
||||
import inspect
|
||||
import itertools
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import List, Tuple
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Any
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import collections
|
||||
import functools
|
||||
import warnings
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import abc
|
||||
import collections
|
||||
import contextlib
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from collections import defaultdict
|
||||
from dataclasses import dataclass
|
||||
from time import perf_counter_ns
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import itertools
|
||||
import warnings
|
||||
from typing_extensions import deprecated
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import bisect
|
||||
import itertools
|
||||
import math
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
from torch._C import _ImperativeEngine as ImperativeEngine
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import types
|
||||
from contextlib import contextmanager
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import hashlib
|
||||
import json
|
||||
from typing import Dict, Tuple
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import List, Optional
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import array
|
||||
import enum
|
||||
import functools
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import contextlib
|
||||
|
||||
from typing import Union
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import os
|
||||
import sys
|
||||
import warnings
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch.cuda
|
||||
|
||||
try:
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user