Realize LazyVariableTracker before raising exception (#163350)

Improves error message reported on #163321

Pull Request resolved: https://github.com/pytorch/pytorch/pull/163350
Approved by: https://github.com/Skylion007, https://github.com/xmfan
This commit is contained in:
Guilherme Leobas
2025-09-19 13:20:56 -03:00
committed by PyTorch MergeBot
parent 03f34fd307
commit bc7b17a36d

View File

@ -68,7 +68,9 @@ def raise_unhashable(arg, tx=None):
tx = InstructionTranslator.current_tx()
raise_observed_exception(
TypeError, tx, args=[ConstantVariable(f"unhashable type: {type(arg)}")]
TypeError,
tx,
args=[ConstantVariable(f"unhashable type: {type(arg.realize())}")],
)