File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
opcode_translator/executor/variables Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change 42
42
log ,
43
43
printable ,
44
44
)
45
+ from ....utils .envs import ENV_SOT_BREAK_GRAPH_ON_GET_SYMBOLIC_VALUE
45
46
from ....utils .exceptions import HasNoAttributeError , InnerError
46
47
from ..dispatch_functions import tensor_numel
47
48
from ..guard import (
@@ -785,6 +786,8 @@ def disable_symbolic(var: VariableBase):
785
786
)
786
787
787
788
def get_py_value (self , allow_tensor : bool = False ) -> bool | int | float :
789
+ if ENV_SOT_BREAK_GRAPH_ON_GET_SYMBOLIC_VALUE .get ():
790
+ raise BreakGraphError ("get_py_value from SymbolicVariable" )
788
791
self .need_guard_value = True
789
792
if isinstance (self .value , SymbolicValue ):
790
793
assert isinstance (
Original file line number Diff line number Diff line change 46
46
ENV_ENABLE_SOT_STEP_PROFILER = BooleanEnvironmentVariable (
47
47
"ENABLE_SOT_STEP_PROFILER" , False
48
48
)
49
+ ENV_SOT_BREAK_GRAPH_ON_GET_SYMBOLIC_VALUE = BooleanEnvironmentVariable (
50
+ "SOT_BREAK_GRAPH_ON_GET_SYMBOLIC_VALUE" , False
51
+ )
49
52
50
53
51
54
@contextmanager
You can’t perform that action at this time.
0 commit comments