Skip to content

Commit

Permalink
build(deps): bump mypy from 1.10.1 to 1.11.0 in /requirements (#2644)
Browse files Browse the repository at this point in the history
* build(deps): bump mypy from 1.10.1 to 1.11.0 in /requirements

Bumps [mypy](https://github.com/python/mypy) from 1.10.1 to 1.11.0.
- [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md)
- [Commits](python/mypy@v1.10.1...v1.11)

---
updated-dependencies:
- dependency-name: mypy
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* drop   # type: ignore[misc]

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: jirka <jirka.borovec@seznam.cz>
(cherry picked from commit 6759f0c)
  • Loading branch information
dependabot[bot] authored and Borda committed Aug 2, 2024
1 parent 75d1cf3 commit 2a610e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion requirements/typing.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mypy ==1.10.1
mypy ==1.11.0
torch ==2.3.1

types-PyYAML
Expand Down
18 changes: 9 additions & 9 deletions src/torchmetrics/metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -985,19 +985,19 @@ def __floordiv__(self, other: Union["Metric", builtins.float, Tensor]) -> "Compo
"""Construct compositional metric using the floor division operator."""
return CompositionalMetric(torch.floor_divide, self, other)

def __ge__(self, other: Union["Metric", builtins.float, Tensor]) -> "CompositionalMetric": # type: ignore[misc]
def __ge__(self, other: Union["Metric", builtins.float, Tensor]) -> "CompositionalMetric":
"""Construct compositional metric using the greater than or equal operator."""
return CompositionalMetric(torch.ge, self, other)

def __gt__(self, other: Union["Metric", builtins.float, Tensor]) -> "CompositionalMetric": # type: ignore[misc]
def __gt__(self, other: Union["Metric", builtins.float, Tensor]) -> "CompositionalMetric":
"""Construct compositional metric using the greater than operator."""
return CompositionalMetric(torch.gt, self, other)

def __le__(self, other: Union["Metric", builtins.float, Tensor]) -> "CompositionalMetric": # type: ignore[misc]
def __le__(self, other: Union["Metric", builtins.float, Tensor]) -> "CompositionalMetric":
"""Construct compositional metric using the less than or equal operator."""
return CompositionalMetric(torch.le, self, other)

def __lt__(self, other: Union["Metric", builtins.float, Tensor]) -> "CompositionalMetric": # type: ignore[misc]
def __lt__(self, other: Union["Metric", builtins.float, Tensor]) -> "CompositionalMetric":
"""Construct compositional metric using the less than operator."""
return CompositionalMetric(torch.lt, self, other)

Expand Down Expand Up @@ -1025,7 +1025,7 @@ def __pow__(self, other: Union["Metric", builtins.float, Tensor]) -> "Compositio
"""Construct compositional metric using the exponential/power operator."""
return CompositionalMetric(torch.pow, self, other)

def __radd__(self, other: Union["Metric", builtins.float, Tensor]) -> "CompositionalMetric": # type: ignore[misc]
def __radd__(self, other: Union["Metric", builtins.float, Tensor]) -> "CompositionalMetric":
"""Construct compositional metric using the addition operator."""
return CompositionalMetric(torch.add, other, self)

Expand All @@ -1042,11 +1042,11 @@ def __rmatmul__(self, other: Union["Metric", builtins.float, Tensor]) -> "Compos
"""Construct compositional metric using the matrix multiplication operator."""
return CompositionalMetric(torch.matmul, other, self)

def __rmod__(self, other: Union["Metric", builtins.float, Tensor]) -> "CompositionalMetric": # type: ignore[misc]
def __rmod__(self, other: Union["Metric", builtins.float, Tensor]) -> "CompositionalMetric":
"""Construct compositional metric using the remainder operator."""
return CompositionalMetric(torch.fmod, other, self)

def __rmul__(self, other: Union["Metric", builtins.float, Tensor]) -> "CompositionalMetric": # type: ignore[misc]
def __rmul__(self, other: Union["Metric", builtins.float, Tensor]) -> "CompositionalMetric":
"""Construct compositional metric using the multiplication operator."""
return CompositionalMetric(torch.mul, other, self)

Expand All @@ -1058,11 +1058,11 @@ def __rpow__(self, other: Union["Metric", builtins.float, Tensor]) -> "Compositi
"""Construct compositional metric using the exponential/power operator."""
return CompositionalMetric(torch.pow, other, self)

def __rsub__(self, other: Union["Metric", builtins.float, Tensor]) -> "CompositionalMetric": # type: ignore[misc]
def __rsub__(self, other: Union["Metric", builtins.float, Tensor]) -> "CompositionalMetric":
"""Construct compositional metric using the subtraction operator."""
return CompositionalMetric(torch.sub, other, self)

def __rtruediv__(self, other: Union["Metric", builtins.float, Tensor]) -> "CompositionalMetric": # type: ignore[misc]
def __rtruediv__(self, other: Union["Metric", builtins.float, Tensor]) -> "CompositionalMetric":
"""Construct compositional metric using the true divide operator."""
return CompositionalMetric(torch.true_divide, other, self)

Expand Down

0 comments on commit 2a610e0

Please sign in to comment.