Skip to content

Commit

Permalink
imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Nov 7, 2024
1 parent e136108 commit 6132d57
Show file tree
Hide file tree
Showing 212 changed files with 194 additions and 214 deletions.
2 changes: 1 addition & 1 deletion .github/assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import os
import re
import sys
from typing import List, Optional, Tuple, Union
from typing import Optional, Union

import fire
from packaging.version import parse
Expand Down
2 changes: 1 addition & 1 deletion _samples/bert_score-own_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"""

from pprint import pprint
from typing import Dict, List, Union
from typing import Union

import torch
from torch import Tensor, nn
Expand Down
1 change: 0 additions & 1 deletion examples/audio/signal_to_noise_ratio.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

# %%
# Import necessary libraries
from typing import Tuple

import matplotlib.animation as animation
import matplotlib.pyplot as plt
Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ lint.per-file-ignores."tests/**" = [
"S101",
"S301", # todo: `pickle` and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue
]
lint.unfixable = [
"F401",
]
# Unlike Flake8, default to a complexity level of 10.
lint.mccabe.max-complexity = 10
# Use Google-style docstrings.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from importlib.util import module_from_spec, spec_from_file_location
from itertools import chain
from pathlib import Path
from typing import Any, List, Optional, Tuple, Union
from typing import Any, Optional, Union

from pkg_resources import Requirement, yield_lines
from setuptools import find_packages, setup
Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/aggregation.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, Callable, List, Optional, Tuple, Union
from typing import Any, Callable, Optional, Union

import torch
from torch import Tensor
Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/audio/pit.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, Callable, Dict, Optional, Union
from typing import Any, Callable, Optional, Union

from torch import Tensor, tensor
from typing_extensions import Literal
Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/classification/accuracy.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, Optional, Type, Union
from typing import Any, Optional, Union

from torch import Tensor
from typing_extensions import Literal
Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/classification/auroc.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, List, Optional, Type, Union
from typing import Any, Optional, Union

from torch import Tensor
from typing_extensions import Literal
Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/classification/average_precision.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, List, Optional, Type, Union
from typing import Any, Optional, Union

from torch import Tensor
from typing_extensions import Literal
Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/classification/calibration_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, List, Optional, Type, Union
from typing import Any, Optional, Union

from torch import Tensor
from typing_extensions import Literal
Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/classification/cohen_kappa.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, Optional, Type, Union
from typing import Any, Optional, Union

from torch import Tensor
from typing_extensions import Literal
Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/classification/confusion_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import Any, List, Optional, Type
from typing import Any, Optional

import torch
from torch import Tensor
Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/classification/dice.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, Callable, Optional, Tuple, Union, no_type_check
from typing import Any, Callable, Optional, Union, no_type_check

import torch
from torch import Tensor
Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/classification/exact_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, Optional, Type, Union
from typing import Any, Optional, Union

import torch
from torch import Tensor
Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/classification/f_beta.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, Optional, Type, Union
from typing import Any, Optional, Union

from torch import Tensor
from typing_extensions import Literal
Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/classification/group_fairness.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, Dict, List, Optional, Tuple, Union
from typing import Any, Optional, Union

import torch
from torch import Tensor
Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/classification/hamming.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, Optional, Type, Union
from typing import Any, Optional, Union

from torch import Tensor
from typing_extensions import Literal
Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/classification/hinge.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, Optional, Type, Union
from typing import Any, Optional, Union

import torch
from torch import Tensor
Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/classification/jaccard.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, Optional, Type, Union
from typing import Any, Optional, Union

from torch import Tensor
from typing_extensions import Literal
Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/classification/matthews_corrcoef.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, Optional, Type, Union
from typing import Any, Optional, Union

from torch import Tensor
from typing_extensions import Literal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, Optional, Type, Union
from typing import Any, Optional, Union

from torch import Tensor
from typing_extensions import Literal
Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/classification/precision_fixed_recall.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, List, Optional, Tuple, Type, Union
from typing import Any, Optional, Union

from torch import Tensor
from typing_extensions import Literal
Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/classification/precision_recall.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, Optional, Type, Union
from typing import Any, Optional, Union

from torch import Tensor
from typing_extensions import Literal
Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/classification/precision_recall_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import Any, List, Optional, Tuple, Type, Union
from typing import Any, Optional, Union

import torch
from torch import Tensor
Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/classification/recall_fixed_precision.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, List, Optional, Tuple, Type, Union
from typing import Any, Optional, Union

from torch import Tensor
from typing_extensions import Literal
Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/classification/roc.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import Any, List, Optional, Tuple, Type, Union
from typing import Any, Optional, Union

from torch import Tensor
from typing_extensions import Literal
Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/classification/sensitivity_specificity.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import Any, List, Optional, Tuple, Type, Union
from typing import Any, Optional, Union

from torch import Tensor
from typing_extensions import Literal
Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/classification/specificity.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, Optional, Type, Union
from typing import Any, Optional, Union

from torch import Tensor
from typing_extensions import Literal
Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/classification/specificity_sensitivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import Any, List, Optional, Tuple, Type, Union
from typing import Any, Optional, Union

from torch import Tensor
from typing_extensions import Literal
Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/classification/stat_scores.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import Any, Callable, List, Optional, Tuple, Type, Union
from typing import Any, Callable, Optional, Union

import torch
from torch import Tensor
Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/clustering/adjusted_mutual_info_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, List, Literal, Optional, Union
from typing import Any, Literal, Optional, Union

from torch import Tensor

Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/clustering/adjusted_rand_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, List, Optional, Union
from typing import Any, Optional, Union

from torch import Tensor

Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/clustering/calinski_harabasz_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, List, Optional, Union
from typing import Any, Optional, Union

from torch import Tensor

Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/clustering/davies_bouldin_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, List, Optional, Union
from typing import Any, Optional, Union

from torch import Tensor

Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/clustering/dunn_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, List, Optional, Union
from typing import Any, Optional, Union

from torch import Tensor

Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/clustering/fowlkes_mallows_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, List, Optional, Union
from typing import Any, Optional, Union

from torch import Tensor

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, List, Optional, Union
from typing import Any, Optional, Union

from torch import Tensor

Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/clustering/mutual_info_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, List, Optional, Union
from typing import Any, Optional, Union

from torch import Tensor

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, List, Literal, Optional, Union
from typing import Any, Literal, Optional, Union

from torch import Tensor

Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/clustering/rand_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Any, List, Optional, Union
from typing import Any, Optional, Union

from torch import Tensor

Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from collections import OrderedDict
from collections.abc import Hashable, Iterable, Iterator, Mapping, Sequence
from copy import deepcopy
from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union
from typing import Any, ClassVar, Optional, Union

import torch
from torch import Tensor
Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/detection/_mean_ap.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
import logging
from collections.abc import Sequence
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
from typing import Any, Callable, Optional, Union

import numpy as np
import torch
Expand Down
2 changes: 1 addition & 1 deletion src/torchmetrics/detection/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from collections.abc import Sequence
from typing import Dict, Literal, Tuple, Union
from typing import Literal, Union

from torch import Tensor

Expand Down
Loading

0 comments on commit 6132d57

Please sign in to comment.