Skip to content

Replace Union with | syntax in psnr.py#3490

Merged
vfdev-5 merged 1 commit intopytorch:masterfrom
JonSnow1807:refactor-typing-psnr
Jan 15, 2026
Merged

Replace Union with | syntax in psnr.py#3490
vfdev-5 merged 1 commit intopytorch:masterfrom
JonSnow1807:refactor-typing-psnr

Conversation

@JonSnow1807
Copy link
Copy Markdown
Contributor

Summary

  • Replace Union[int, float] with int | float
  • Replace Union[str, torch.device] with str | torch.device
  • Remove Union from typing import (keep Callable, Sequence)

Part of #3481

Test plan

  • Import check verified

Part of pytorch#3481: Update typing hints to use Python 3.10+ syntax.
@github-actions github-actions bot added the module: metrics Metrics module label Jan 15, 2026
Copy link
Copy Markdown
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @JonSnow1807 !

@vfdev-5 vfdev-5 added this pull request to the merge queue Jan 15, 2026
Merged via the queue into pytorch:master with commit f67d595 Jan 15, 2026
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: metrics Metrics module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants