Hi, yes you can run:
old_prof_exec_state = torch._C._jit_set_profiling_executor(True)
old_prof_mode_state = torch._C._jit_set_profiling_mode(True)
torch._C._jit_set_num_profiled_runs(num_runs)

run your scripted function/module for some number of times,
then run:
torch.jit.last_executed_optimized_graph()