[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:
Aaron Gokaslan
2025-08-08 03:14:55 +00:00
committed by PyTorch MergeBot
parent 3fcd79e023
commit beb4d7816d
15 changed files with 25 additions and 28 deletions

View File

@ -168,4 +168,4 @@ def merge_operator_dicts(
def strip_operator_overload_name(op_name: str) -> str:
return op_name.split(".")[0]
return op_name.split(".", maxsplit=1)[0]