File tree Expand file tree Collapse file tree 3 files changed +5
-12
lines changed Expand file tree Collapse file tree 3 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -3704,9 +3704,6 @@ def f(x):
37043704 with self .assertRaises (RuntimeError ):
37053705 torch .jit .trace (f , torch .randn (3 ))
37063706
3707- with torch ._dynamo .config .patch (error_on_nested_jit_trace = False ):
3708- torch .jit .trace (f , torch .randn (3 ))
3709-
37103707 @torch ._dynamo .config .patch ("assume_static_by_default" , False )
37113708 def test_tensor_split (self ):
37123709 def f (x ):
Original file line number Diff line number Diff line change @@ -334,8 +334,7 @@ def _get_optimize_ddp_mode():
334334# If True, raise when aot autograd is unsafe to use
335335raise_on_unsafe_aot_autograd = False
336336
337- # If true, error if you torch.jit.trace over a dynamo-optimized function.
338- # If false, silently suppress dynamo
337+ # This flag is ignored and maintained for backwards compatibility.
339338error_on_nested_jit_trace = True
340339
341340# If true, error with a better message if we symbolically trace over a
Original file line number Diff line number Diff line change @@ -440,13 +440,10 @@ def _fn(*args, **kwargs):
440440 return fn (* args , ** kwargs )
441441
442442 if is_jit_tracing ():
443- if config .error_on_nested_jit_trace :
444- raise RuntimeError (
445- "Detected that you are using FX to torch.jit.trace "
446- "a dynamo-optimized function. This is not supported at the moment."
447- )
448- else :
449- return fn (* args , ** kwargs )
443+ raise RuntimeError (
444+ "Detected that you are using FX to torch.jit.trace "
445+ "a dynamo-optimized function. This is not supported at the moment."
446+ )
450447
451448 cleanups = [enter () for enter in self .enter_exit_hooks ]
452449 prior = _maybe_set_eval_frame (callback )
You can’t perform that action at this time.
0 commit comments