mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
More ruff SIM fixes (#164695)
This PR applies ruff `SIM` rules to more files. Most changes are about simplifying `dict.get` because `None` is already the default value. Pull Request resolved: https://github.com/pytorch/pytorch/pull/164695 Approved by: https://github.com/ezyang
This commit is contained in:
committed by
PyTorch MergeBot
parent
54ae61c573
commit
a029675f6f
@ -127,7 +127,7 @@ class TestVisibleDeviceParses(TestCase):
|
||||
_transform_uuid_to_ordinals(["GPU-e4", "GPU-9e8d35e3"], uuids), [2, 1]
|
||||
)
|
||||
self.assertEqual(
|
||||
_transform_uuid_to_ordinals("GPU-9e8d35e3,GPU-1,GPU-47".split(","), uuids),
|
||||
_transform_uuid_to_ordinals(["GPU-9e8d35e3", "GPU-1", "GPU-47"], uuids),
|
||||
[1, 7, 5],
|
||||
)
|
||||
# First invalid UUID aborts parsing
|
||||
|
Reference in New Issue
Block a user