Repository navigation
Commit 623cf19
Fix four error messages that printed their placeholders (pytorch#23104)
### Summary
Four raised errors were plain strings, not f-strings, so users see the
literal placeholder instead of the value:
| File | Message |
|---|---|
| `exir/passes/quantize_io_pass.py` | `Output {output_index} is not a
dequantize op` |
| `exir/dialects/edge/dtype/runner.py` | `Type {t.name} does not have
dtype` |
| `backends/cortex_m/quantizer_reporter.py` | `Node {node.name} reported
as annotated but has no quantization annotation.` |
| `backends/arm/_passes/insert_table_ops.py` | `Table op for {target}
does not exist` |
For example, asking `QuantizeOutputs` to quantize an output that isn't a
dequantize op raises `ValueError: Output {output_index} is not a
dequantize op`. That doesn't say which output. Each fix adds the missing
`f` prefix, and no other code changes.
### Test plan
- Each changed line only adds an `f` prefix, and every variable it names
is in scope at the `raise`. All four files compile.
- `black` 24.4.2 and `flake8` 6.1.0, the lintrunner pins, pass on the
changed files. `ruff` 0.15.4 reports the same pre-existing findings as
`main`, all docstring rules, and nothing new.
This PR was authored with AI assistance (Claude Code). I found these
with a scan for string literals that contain `{name}` placeholders but
are never formatted.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils
@Sebastian-Larsson @robell @rascani
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent e07f9df commit 623cf19
4 files changed
Lines changed: 4 additions & 4 deletions
File tree
- backends
- arm/_passes
- cortex_m
- exir
- dialects/edge/dtype
- passes
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| |||
0 commit comments