mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[BE]: ruff PLC0207 - use maxsplit kwarg (#160107)
Automatically replaces split with rsplit when relevant and only performs the split up to the first ( or last value). This allows early return of the split function and improve efficiency. Pull Request resolved: https://github.com/pytorch/pytorch/pull/160107 Approved by: https://github.com/albanD
This commit is contained in:
committed by
PyTorch MergeBot
parent
3fcd79e023
commit
beb4d7816d
@ -2017,7 +2017,7 @@ def skipIfRocmVersionLessThan(version=None):
|
||||
def wrap_fn(self, *args, **kwargs):
|
||||
if TEST_WITH_ROCM:
|
||||
rocm_version = str(torch.version.hip)
|
||||
rocm_version = rocm_version.split("-")[0] # ignore git sha
|
||||
rocm_version = rocm_version.split("-", maxsplit=1)[0] # ignore git sha
|
||||
rocm_version_tuple = tuple(int(x) for x in rocm_version.split("."))
|
||||
if rocm_version_tuple is None or version is None or rocm_version_tuple < tuple(version):
|
||||
reason = f"ROCm {rocm_version_tuple} is available but {version} required"
|
||||
|
Reference in New Issue
Block a user