Solved by eellison in post #4 
              
              
                old_prof_exec_state = torch._C._jit_set_profiling_executor(True) 
old_prof_mode_state = torch._C._jit_set_profiling_mode(True) 

this enables the profiling executor. 

torch._C._jit_set_num_profiled_runs(num_runs) 

how many profiling runs we want to do before we optimize the graph. 
@torch.jit.scr…