Skip to content

Replace Union with | syntax in mean_squared_error.py#3485

Merged
vfdev-5 merged 2 commits intopytorch:masterfrom
JonSnow1807:refactor-typing-mean-squared-error
Jan 15, 2026
Merged

Replace Union with | syntax in mean_squared_error.py#3485
vfdev-5 merged 2 commits intopytorch:masterfrom
JonSnow1807:refactor-typing-mean-squared-error

Conversation

@JonSnow1807
Copy link
Copy Markdown
Contributor

Summary

  • Replace Union[float, torch.Tensor] with float | torch.Tensor
  • Remove Union from typing import (keep Sequence)

Part of #3481

Test plan

  • Existing tests pass (42 passed)
  • 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 enabled auto-merge January 15, 2026 10:49
@vfdev-5 vfdev-5 added this pull request to the merge queue Jan 15, 2026
Merged via the queue into pytorch:master with commit 4e8950b Jan 15, 2026
24 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