import tensorflow as tf


import numpy as np
import tensorflow as tf

from evaluation import factory


def write_summary(logs, summary_writer, current_step):
  """Write out summaries of current training step for the checkpoint."""
  with tf.Graph().as_default():
    summaries = [tf.Summary.Value(tag=tag, simple_value=value)
                 for tag, value in logs.items()]
    tf_summary = tf.Summary(value=summaries)
    summary_writer.add_summary(tf_summary, current_step)


class TpuExecutor(object):
  """An executor class for running jobs on TPUs."""

  def __init__(self, model_fn, params):
    self._model_dir = params.model_dir
    # Sets up evaluator.
    self._evaluator = factory.evaluator_generator(params.eval)

