mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[4/N] Apply py39 ruff and pyupgrade fixes (#143257)
```torch/fx/passes/annotate_getitem_nodes.py``` was changed to support the new type hinting annotations. Pull Request resolved: https://github.com/pytorch/pytorch/pull/143257 Approved by: https://github.com/justinchuby, https://github.com/albanD
This commit is contained in:
@ -15,7 +15,7 @@ from torch.testing._internal.common_utils import TestCase, run_tests, skipIfRocm
|
||||
skipIfCrossRef
|
||||
from torch.testing._internal.common_cuda import TEST_CUDA
|
||||
from numbers import Number
|
||||
from typing import Dict, Any
|
||||
from typing import Any
|
||||
from packaging import version
|
||||
from torch.testing._internal.common_cuda import \
|
||||
(SM53OrLater, SM80OrLater, TEST_MULTIGPU)
|
||||
@ -334,7 +334,7 @@ class TestSparse(TestSparseBase):
|
||||
self.assertEqual(t._values(), tc._values())
|
||||
return tc
|
||||
|
||||
value_map: Dict[Any, Any] = {}
|
||||
value_map: dict[Any, Any] = {}
|
||||
for idx, val in zip(t._indices().t(), t._values()):
|
||||
idx_tup = tuple(idx.tolist())
|
||||
if idx_tup in value_map:
|
||||
|
Reference in New Issue
Block a user