code: def create_session_config(
      log_device_placement=False,
      enable_graph_rewriter=False,
      gpu_mem_fraction=0.95,
      use_tpu=False,
      xla_jit_level=tf.OptimizerOptions.OFF,
      inter_op_parallelism_threads=0,
      intra_op_parallelism_threads=0,
  ):
      """The TensorFlow Session config to use."""
      if use_tpu:
          graph_options = tf.GraphOptions()
      else:
          if enable_graph_rewriter:
              rewrite_options = rewriter_config_pb2.RewriterConfig()
              rewrite_options.layout_optimizer = (
                  rewriter_config_pb2.RewriterConfig.ON
              )
              graph_options = tf.GraphOptions(
                  rewrite_options=rewrite_options
              )
          else:
              graph_options = tf.GraphOptions(
                  optimizer_options=tf.OptimizerOptions(
                      opt_level=tf.OptimizerOptions.L1,
                      do_function_inlining=False,
                      global_jit_level=xla_jit_level,
                  )
              )
  
      gpu_options = tf.GPUOptions(
          per_process_gpu_memory_fraction=gpu_mem_fraction
      )
  
      config = tf.ConfigProto(
          allow_soft_placement=True,
          graph_options=graph_options,
          gpu_options=gpu_options,
          log_device_placement=log_device_placement,
          inter_op_parallelism_threads=inter_op_parallelism_threads,
          intra_op_parallelism_threads=intra_op_parallelism_threads,
          isolate_session_state=True,
      )
      return config
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import contextlib
  import json
  import os
  import random
  import numpy
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import decoding
  from tensor2tensor.utils import devices
  from tensor2tensor.utils import hparams_lib
  from tensor2tensor.utils import metrics_hook
  from tensor2tensor.utils import mlperf_log
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import t2t_model
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
  from tensorflow.core.protobuf import rewriter_config_pb2
  from tensorflow.python import debug
label_desc: Use image node_id 3 for calling a global function with example usage: create_session_config(log_device_placement, enable_graph_rewriter, gpu_mem_fraction, use_tpu, xla_jit_level, inter_op_parallelism_threads, intra_op_parallelism_threads) and returns: config