Skip to content

Commit 5f43e44

Browse files
dependabot[bot]rittik9pre-commit-ci[bot]
authored
build(deps): bump mypy from 1.17.1 to 1.18.1 in /requirements (#3264)
* build(deps): bump mypy from 1.17.1 to 1.18.1 in /requirements Bumps [mypy](https://github.com/python/mypy) from 1.17.1 to 1.18.1. - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](python/mypy@v1.17.1...v1.18.1) --- updated-dependencies: - dependency-name: mypy dependency-version: 1.18.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update ssim.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update squad.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update ssim.py * Update ssim.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Rittik Panda <rittikpanda24@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 000ac22 commit 5f43e44

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

requirements/typing.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
mypy ==1.17.1
1+
mypy ==1.18.2
22
torch ==2.8.0
33

44
types-PyYAML

src/torchmetrics/functional/image/ssim.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,14 @@ def _ssim_update(
111111
raise ValueError(f"Expected `sigma` to have positive number. Got {sigma}.")
112112

113113
if data_range is None:
114-
data_range = max(preds.max() - preds.min(), target.max() - target.min()) # type: ignore[call-overload]
114+
data_range = max(preds.max() - preds.min(), target.max() - target.min()).item()
115115
elif isinstance(data_range, tuple):
116116
preds = torch.clamp(preds, min=data_range[0], max=data_range[1])
117117
target = torch.clamp(target, min=data_range[0], max=data_range[1])
118118
data_range = data_range[1] - data_range[0]
119119

120-
c1 = pow(k1 * data_range, 2) # type: ignore[operator]
121-
c2 = pow(k2 * data_range, 2) # type: ignore[operator]
120+
c1 = pow(k1 * data_range, 2)
121+
c2 = pow(k2 * data_range, 2)
122122
device = preds.device
123123

124124
channel = preds.size(1)

src/torchmetrics/functional/text/squad.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def _metric_max_over_ground_truths(
8787
metric_fn: Callable[[str, str], Tensor], prediction: str, ground_truths: list[str]
8888
) -> Tensor:
8989
"""Calculate maximum score for a predicted answer with all reference answers."""
90-
return max(metric_fn(prediction, truth) for truth in ground_truths) # type: ignore[type-var]
90+
return max(metric_fn(prediction, truth) for truth in ground_truths)
9191

9292

9393
def _squad_input_check(

0 commit comments

Comments
 (0)