def build_run_config():
    'Return RunConfig for TPU estimator.'
    tpu_cluster_resolver = tf.contrib.cluster_resolver.TPUClusterResolver(FLAGS.tpu, zone=FLAGS.tpu_zone, project=FLAGS.gcp_project)
    eval_steps = (FLAGS.num_eval_images // FLAGS.eval_batch_size)
    iterations_per_loop = (eval_steps if (FLAGS.mode == 'eval') else FLAGS.iterations_per_loop)
    save_checkpoints_steps = (FLAGS.save_checkpoints_steps or iterations_per_loop)
    run_config = tf.contrib.tpu.RunConfig(cluster=tpu_cluster_resolver, model_dir=FLAGS.model_dir, save_checkpoints_steps=save_checkpoints_steps, keep_checkpoint_max=None, tpu_config=tf.contrib.tpu.TPUConfig(iterations_per_loop=iterations_per_loop, num_shards=FLAGS.num_shards, per_host_input_for_training=tf.contrib.tpu.InputPipelineConfig.PER_HOST_V2))
    return run_config
Return RunConfig for TPU estimator.
def build_run_config():
    
    tpu_cluster_resolver = tf.contrib.cluster_resolver.TPUClusterResolver(FLAGS.tpu, zone=FLAGS.tpu_zone, project=FLAGS.gcp_project)
    eval_steps = (FLAGS.num_eval_images // FLAGS.eval_batch_size)
    iterations_per_loop = (eval_steps if (FLAGS.mode == 'eval') else FLAGS.iterations_per_loop)
    save_checkpoints_steps = (FLAGS.save_checkpoints_steps or iterations_per_loop)
    run_config = tf.contrib.tpu.RunConfig(cluster=tpu_cluster_resolver, model_dir=FLAGS.model_dir, save_checkpoints_steps=save_checkpoints_steps, keep_checkpoint_max=None, tpu_config=tf.contrib.tpu.TPUConfig(iterations_per_loop=iterations_per_loop, num_shards=FLAGS.num_shards, per_host_input_for_training=tf.contrib.tpu.InputPipelineConfig.PER_HOST_V2))
    return run_config