[2/N] Apply ruff UP035 check in torch files (#164054)

This is the result of applying the ruff `UP035` check.
`Callable` is imported from `collections.abc` instead of `typing`.
`TypeAlias` is also imported from `typing`.
This PR is the follow-up of #163947.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/164054
Approved by: https://github.com/ezyang, https://github.com/Skylion007
This commit is contained in:
Yuanyuan Chen
2025-09-29 03:35:32 +00:00
committed by PyTorch MergeBot
parent 352197c508
commit 3cda34ebde
48 changed files with 92 additions and 79 deletions

View File

@ -1,7 +1,7 @@
import base64
import zlib
from collections.abc import Iterable
from typing import Callable, Generic, TypeVar
from collections.abc import Callable, Iterable
from typing import Generic, TypeVar
T = TypeVar("T")