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 [6/11] (#127843)
See #127836 for details. Pull Request resolved: https://github.com/pytorch/pytorch/pull/127843 Approved by: https://github.com/oulgen ghstack dependencies: #127842
This commit is contained in:
committed by
PyTorch MergeBot
parent
3a0d088517
commit
7c12cc7ce4
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# mypy: allow-untyped-defs
|
||||
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
# All rights reserved.
|
||||
|
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# mypy: allow-untyped-defs
|
||||
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
# All rights reserved.
|
||||
|
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# mypy: allow-untyped-defs
|
||||
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
# All rights reserved.
|
||||
|
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# mypy: allow-untyped-defs
|
||||
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
# All rights reserved.
|
||||
|
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# mypy: allow-untyped-defs
|
||||
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
# All rights reserved.
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
import torchvision
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""
|
||||
This file includes private common utilities for FSDP.
|
||||
"""
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import logging
|
||||
import time
|
||||
from collections import defaultdict
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Set
|
||||
|
||||
import torch.nn as nn
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import itertools
|
||||
import warnings
|
||||
from enum import auto, Enum
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import contextlib
|
||||
import functools
|
||||
import logging
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import collections
|
||||
import itertools
|
||||
import os
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import copy
|
||||
import functools
|
||||
import logging
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import functools
|
||||
import logging
|
||||
from enum import auto, Enum
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import copy
|
||||
import itertools
|
||||
import math
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import contextlib
|
||||
import logging
|
||||
import math
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import functools
|
||||
from contextlib import contextmanager
|
||||
from dataclasses import dataclass, field
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import contextlib
|
||||
import warnings
|
||||
from typing import cast, Generator
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import collections
|
||||
import functools
|
||||
import inspect
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import logging
|
||||
from collections import abc, defaultdict
|
||||
from typing import Any, Dict, Iterable, List, Optional, overload, Sequence, Tuple, Union
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
#
|
||||
# This source code is licensed under the BSD license found in the
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
r"""
|
||||
Module ``torch.distributed.launch``.
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# mypy: allow-untyped-defs
|
||||
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
# All rights reserved.
|
||||
|
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python3
|
||||
# mypy: allow-untyped-defs
|
||||
import collections
|
||||
import io
|
||||
import sys
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
import torch.distributed as dist
|
||||
from torch.autograd import Function
|
||||
|
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python3
|
||||
# mypy: allow-untyped-defs
|
||||
import importlib
|
||||
import logging
|
||||
import os
|
||||
|
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python3
|
||||
# mypy: allow-untyped-defs
|
||||
|
||||
|
||||
def get_remote_module_template(enable_moving_cpu_tensors_to_cuda: bool):
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Dict, List, Optional, Tuple
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Dict, List, Optional, Tuple
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Dict, List, Optional, Tuple
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Dict, List, Optional, Tuple
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import logging
|
||||
import warnings
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import logging
|
||||
|
||||
from collections import defaultdict
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import warnings
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Type
|
||||
|
||||
from torch import optim
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import enum
|
||||
from typing import Any, Callable, Dict, List, Optional, overload, Set, Type
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates
|
||||
import copy
|
||||
import logging
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates
|
||||
from typing import List, Optional
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates
|
||||
import torch
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates
|
||||
from typing import Dict
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates
|
||||
import logging
|
||||
from dataclasses import dataclass
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates
|
||||
import logging
|
||||
from typing import Any, Dict, List, Optional, Tuple
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates
|
||||
|
||||
import logging
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates
|
||||
import logging
|
||||
import operator
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Optional, Union
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
try:
|
||||
from urllib.parse import urlparse, urlunparse
|
||||
except ImportError as e:
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from datetime import timedelta
|
||||
import logging
|
||||
import os
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
|
||||
import torch
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# mypy: allow-untyped-defs
|
||||
|
||||
import torch.distributed as dist
|
||||
import torch.distributed.rpc as rpc
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from contextlib import contextmanager
|
||||
from typing import cast
|
||||
import logging
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
__all__ = ["shutdown", "get_worker_info", "remote", "rpc_sync",
|
||||
"rpc_async", "RRef", "AllGatherStates", "method_factory", "new_method"]
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
__all__ = ["init_backend", "backend_registered", "construct_rpc_backend_options", "register_backend", "BackendType", "BackendValue"]
|
||||
|
||||
import collections
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import functools
|
||||
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import collections
|
||||
import copyreg
|
||||
import io
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Dict, List, Optional, Union
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from functools import partial
|
||||
|
||||
from . import functions
|
||||
|
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python3
|
||||
# mypy: allow-untyped-defs
|
||||
|
||||
import itertools
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# mypy: allow-untyped-defs
|
||||
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
# All rights reserved.
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import warnings
|
||||
from typing import Tuple, Union
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Any, List, Tuple
|
||||
|
||||
import torch.nn as nn
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import copy
|
||||
from typing import Any, cast, List, Optional, Tuple
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates
|
||||
import contextlib
|
||||
from typing import cast, Dict, Optional, Tuple
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Optional, Union, Tuple, Dict
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import dataclasses
|
||||
import traceback
|
||||
from typing import (
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from numbers import Number
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from numbers import Number, Real
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
from torch.distributions import constraints
|
||||
from torch.distributions.distribution import Distribution
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
from torch import nan
|
||||
from torch.distributions import constraints
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import math
|
||||
from numbers import Number
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from torch.distributions import constraints
|
||||
from torch.distributions.gamma import Gamma
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
r"""
|
||||
PyTorch provides two global :class:`ConstraintRegistry` objects that link
|
||||
:class:`~torch.distributions.constraints.Constraint` objects to
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
r"""
|
||||
The following constraints are implemented:
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import math
|
||||
from numbers import Number
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
from torch.autograd import Function
|
||||
from torch.autograd.function import once_differentiable
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import warnings
|
||||
from typing import Any, Dict, Optional, Tuple
|
||||
from typing_extensions import deprecated
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
from torch.distributions.distribution import Distribution
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from numbers import Number
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from numbers import Number
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from numbers import Number
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from numbers import Number
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import math
|
||||
from numbers import Number
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import math
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import math
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Dict
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
from torch.distributions import constraints
|
||||
from torch.distributions.gamma import Gamma
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import math
|
||||
import warnings
|
||||
from functools import total_ordering
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
from torch import nan
|
||||
from torch.distributions import constraints
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from numbers import Number
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
"""
|
||||
This closely follows the implementation in NumPyro (https://github.com/pyro-ppl/numpyro).
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from torch.distributions import constraints
|
||||
from torch.distributions.normal import Normal
|
||||
from torch.distributions.transformed_distribution import TransformedDistribution
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from torch.distributions import constraints
|
||||
from torch.distributions.normal import Normal
|
||||
from torch.distributions.transformed_distribution import TransformedDistribution
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import math
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from typing import Dict
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
from torch import inf
|
||||
from torch.distributions import Categorical, constraints
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import math
|
||||
|
||||
import torch
|
||||
|
@ -1,3 +1,4 @@
|
||||
# mypy: allow-untyped-defs
|
||||
import torch
|
||||
import torch.nn.functional as F
|
||||
from torch.distributions import constraints
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user