[BE] Enable ruff's UP rules and autoformat benchmarks/ (#105429)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/105429
Approved by: https://github.com/malfet
This commit is contained in:
Justin Chu
2023-07-19 02:04:18 +00:00
committed by PyTorch MergeBot
parent 9c225c9b9a
commit 5ef023b05a
43 changed files with 129 additions and 151 deletions

View File

@ -355,14 +355,14 @@ def run_benchmark(rank, args, data):
rpc.shutdown()
def get_json_config(file_name, id):
def get_json_config(file_name: str, id: str):
r"""
A function that loads a json configuration from a file.
Args:
file_name (str): name of configuration file to load
id (str): configuration that will be loaded
"""
with open(os.path.join(Path(__file__).parent, file_name), "r") as f:
with open(Path(__file__).parent / file_name) as f:
json_config = json.load(f)[id]
return json_config