code: def _get_run_config(config):
      gpu_options = tf.GPUOptions(
          per_process_gpu_memory_fraction=config[
              "per_process_gpu_memory_fraction"
          ],
          allow_growth=config["gpu_allow_growth"],
      )
      sess_config = tf.ConfigProto(
          gpu_options=gpu_options,
          log_device_placement=config["log_device_placement"],
      )
  
      run_config = tf.estimator.RunConfig(
          model_dir=config["model_dir"],
          tf_random_seed=config["tf_random_seed"],
          save_summary_steps=config["save_summary_steps"],
          save_checkpoints_steps=config["save_checkpoints_steps"],
          save_checkpoints_secs=config["save_checkpoints_secs"],
          keep_checkpoint_max=config["keep_checkpoint_max"],
          keep_checkpoint_every_n_hours=config[
              "keep_checkpoint_every_n_hours"
          ],
          log_step_count_steps=config["log_step_count_steps"],
          session_config=sess_config,
      )
  
      return run_config
  
file_path: texar/bin/train.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import tempfile
  import yaml
  import tensorflow
  from texar.tf import utils
  from texar.tf.run import Executor
label_desc: Use image node_id 2 for calling a global function with example usage: _get_run_config(config) and returns: run_config