Commit fb5be22
Refactor: Remove unnecessary ConstantVariable wrapping in raise_observed_exception (pytorch#168337)
Fixes pytorch#168291
# Summary
Removes `ConstantVariable.create` wrapping in `raise_observed_exception` calls within `torch/_dynamo/variables/functions.py`.
# Context
The `raise_observed_exception` function handles the exception creation internally. Wrapping the error strings in `ConstantVariable` is unnecessary and can be simplified to passing raw strings.
# Test Plan
- [x] Verified syntax validity via `python3 -m py_compile torch/_dynamo/variables/functions.py`
- [ ] CI/CD (Existing tests should pass as this is a refactor of error reporting paths)
Pull Request resolved: pytorch#168337
Approved by: https://github.com/williamwen42, https://github.com/guilhermeleobas, https://github.com/cyyever1 parent bb30341 commit fb5be22
1 file changed
+5
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
| 213 | + | |
218 | 214 | | |
219 | 215 | | |
220 | 216 | | |
| |||
226 | 222 | | |
227 | 223 | | |
228 | 224 | | |
229 | | - | |
230 | | - | |
231 | | - | |
| 225 | + | |
232 | 226 | | |
233 | 227 | | |
234 | 228 | | |
| |||
245 | 239 | | |
246 | 240 | | |
247 | 241 | | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
| 242 | + | |
253 | 243 | | |
254 | 244 | | |
255 | 245 | | |
| |||
259 | 249 | | |
260 | 250 | | |
261 | 251 | | |
262 | | - | |
263 | | - | |
264 | | - | |
| 252 | + | |
265 | 253 | | |
266 | 254 | | |
267 | 255 | | |
| |||
2994 | 2982 | | |
2995 | 2983 | | |
2996 | 2984 | | |
2997 | | - | |
| 2985 | + | |
2998 | 2986 | | |
2999 | 2987 | | |
3000 | 2988 | | |
| |||
0 commit comments