parameters: (should_optimize)
docstring: A context manager that controls whether the JIT's executor will run
      optimizations before executing a function.
docstring_summary: A context manager that controls whether the JIT's executor will run
      optimizations before executing a function.
docstring_tokens: A context manager that controls whether the JIT s executor will run optimizations before executing a function .
function: def optimized_execution(should_optimize):
      """
      A context manager that controls whether the JIT's executor will run
      optimizations before executing a function.
      """
      stored_flag = torch._C._get_graph_executor_optimize()
      torch._C._set_graph_executor_optimize(should_optimize)
      try:
          yield
      finally:
          torch._C._set_graph_executor_optimize(stored_flag)
function_tokens: def optimized_execution ( should_optimize ) : stored_flag = torch . _C . _get_graph_executor_optimize ( ) torch . _C . _set_graph_executor_optimize ( should_optimize ) try : yield finally : torch . _C . _set_graph_executor_optimize ( stored_flag )