[easy] fix f-string messages in torch/_ops.py (#132531)

I encountered these when making this change:

```
diff --git a/test/functorch/test_ac.py b/test/functorch/test_ac.py
index 3a2e07fa147..a4d003399e7 100644
--- a/test/functorch/test_ac.py
+++ b/test/functorch/test_ac.py
@@ -259,15 +259,8 @@ class MemoryBudgetTest(TestCase):

         expected = call()
         for budget in range(0, 11):
-            memory_budget = budget / 10
-            torch._dynamo.reset()
-            with config.patch(activation_memory_budget=memory_budget):
-                if memory_budget is not None:
-                    f_compile = torch.compile(
-                        call, backend="aot_eager_decomp_partition"
-                    )
-
-                self.assertEqual(expected, f_compile())
+            get_mem_and_flops(call, memory_budget=budget / 10)
+

     def test_prioritize_cheaper_matmul(self):
         def f(xs, ws):
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/132531
Approved by: https://github.com/Skylion007
This commit is contained in:
David Berard 2024-08-05 09:26:02 -07:00 committed by PyTorch MergeBot
parent aec948adfc
commit e1c2bdac2f

View File

@ -334,7 +334,7 @@ class HigherOrderOperator(OperatorBase):
result = handler(mode, *args, **kwargs)
else:
raise NotImplementedError(
"There was no rule registered for HOP {self._name} and mode {curr_mode}. "
f"There was no rule registered for HOP {self._name} and mode {curr_mode}. "
"We recommend filing an issue."
)
if result is not NotImplemented:
@ -355,7 +355,7 @@ class HigherOrderOperator(OperatorBase):
result = handler(*args, **kwargs)
else:
raise NotImplementedError(
"There was no rule registered for HOP {self._name} and subclass {subclass_type}. "
f"There was no rule registered for HOP {self._name} and subclass {subclass_type}. "
"We recommend filing an issue."
)
if result is not NotImplemented: