Refactor exception handling in torch._dynamo with raise_python_observed_exception (#178619)
Summary:
Introduce a new convenience wrapper raise_python_observed_exception() that
automatically converts Python string arguments to VariableTrackers. This reduces
boilerplate and centralizes the pattern of wrapping string literals in exception
arguments.
Authored with Claude.
X-link: https://github.com/pytorch/pytorch/pull/178619
Approved by: https://github.com/Lucaskabela
Reviewed By: izaitsevfb
Differential Revision: D98790070
fbshipit-source-id: 08dd97124d19d64416bf1da22d214f49c93e52e1
Co-authored-by: Claude Copilot <223556219+Copilot@users.noreply.github.com>
Author
generatedunixname499836121