[BE] f-stringify torch/ and scripts (#105538)

This PR is a follow up on the pyupgrade series to convert more strings to use f-strings using `flynt`.

- https://docs.python.org/3/reference/lexical_analysis.html#f-strings
- https://pypi.org/project/flynt/

Command used:

```
flynt torch/ -ll 120
flynt scripts/ -ll 120
flynt tools/ -ll 120
```

and excluded `collect_env.py`

Pull Request resolved: https://github.com/pytorch/pytorch/pull/105538
Approved by: https://github.com/ezyang, https://github.com/malfet
This commit is contained in:
Justin Chu
2023-07-21 08:23:48 -07:00
committed by PyTorch MergeBot
parent 4c73016ff2
commit 4cc1745b13
139 changed files with 350 additions and 670 deletions

View File

@ -61,9 +61,7 @@ class GenOperatorsYAMLTest(unittest.TestCase):
filtered_configs = list(filter(filter_func, config))
assert (
len(filtered_configs) == 2
), "Expected 2 elements in filtered_configs, but got {}".format(
len(filtered_configs)
)
), f"Expected 2 elements in filtered_configs, but got {len(filtered_configs)}"
def test_verification_success(self):
filter_func = make_filter_from_options(