[Dynamo][Logging]Fix regression on stack adding to latest bytecode by… (#165946)

… adding verbose check (#165926)

[ghstack-poisoned]

Fixes #ISSUE_NUMBER

Pull Request resolved: https://github.com/pytorch/pytorch/pull/165946
Approved by: https://github.com/williamwen42
This commit is contained in:
Xiao 2025-10-24 20:36:50 +00:00 committed by PyTorch MergeBot
parent 2c851c16e5
commit 6038e476e8

View File

@ -1363,6 +1363,7 @@ class InstructionTranslatorBase(
# Store the latest 20 bytecode execution for the process, # Store the latest 20 bytecode execution for the process,
# Used repr for byte processing and limiting the length to 2048 # Used repr for byte processing and limiting the length to 2048
if config.verbose:
try: try:
stack_repr = repr(self.stack) stack_repr = repr(self.stack)
except ValueError: except ValueError: