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
@ -2552,7 +2552,7 @@ def _get_cpp_prefix_header(device: str) -> Optional[str]:
|
||||
def _get_cpp_wrapper_header(device: str, aot_mode: bool = False) -> str:
|
||||
"""Given a device type (and optionally whether we're in AOT Inductor mode), returns
|
||||
the path to the cpp_wrapper header file to be precompiled."""
|
||||
base_device = device.split(":")[0]
|
||||
base_device = device.split(":", maxsplit=1)[0]
|
||||
is_array_ref = config.aot_inductor.allow_stack_allocation and base_device == "cpu"
|
||||
return (
|
||||
"torch/csrc/inductor/"
|
||||
|
Reference in New Issue
Block a user