[BE][Ez]: ISC001 Auto concatenate implicit one line strings (#146408)

Apply ruff rule about implicit string concatenation, this autofixes strings that are all the same type and on the same line. These lines are broken up likely as the result of autoformatters in the past. All fixes are automated using the autofixes in ISC001.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/146408
Approved by: https://github.com/justinchuby, https://github.com/janeyx99
This commit is contained in:
Aaron Gokaslan
2025-02-04 19:07:02 +00:00
committed by PyTorch MergeBot
parent f38a2ea0d4
commit 292af3cc89
36 changed files with 56 additions and 64 deletions

View File

@ -706,13 +706,13 @@ class Module:
for item in atoms:
if not hasattr(mod, item):
raise AttributeError(
mod._get_name() + " has no " "attribute `" + item + "`"
mod._get_name() + " has no attribute `" + item + "`"
)
mod = getattr(mod, item)
if not isinstance(mod, torch.nn.Module):
raise AttributeError("`" + item + "` is not " "an nn.Module")
raise AttributeError("`" + item + "` is not an nn.Module")
return mod
@ -829,7 +829,7 @@ class Module:
param: torch.nn.Parameter = getattr(mod, param_name)
if not isinstance(param, torch.nn.Parameter):
raise AttributeError("`" + param_name + "` is not an " "nn.Parameter")
raise AttributeError("`" + param_name + "` is not an nn.Parameter")
return param