[BE] Enable ruff's UP rules and autoformat test/ (#105434)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/105434
Approved by: https://github.com/albanD
This commit is contained in:
Justin Chu
2023-07-19 07:40:18 -07:00
committed by PyTorch MergeBot
parent 7b56238551
commit 73e1455327
88 changed files with 427 additions and 451 deletions

View File

@ -83,7 +83,7 @@ class TestAutocastCPU(TestCase):
control = getattr(args[0].to(run_as_type), op)(*cast(args[1:], run_as_type), **add_kwargs)
self.assertTrue(type(output_to_compare) == type(control))
comparison = compare(output_to_compare, control)
self.assertTrue(comparison, "torch.{} result did not match control".format(op))
self.assertTrue(comparison, f"torch.{op} result did not match control")
self.assertTrue(torch.is_autocast_cpu_enabled())
self.assertFalse(torch.is_autocast_cpu_enabled())