'Initializer for ExamplesPerSecondHook.
Args:
batch_size: Total batch size used to calculate examples/second from
global time.
every_n_steps: Log stats every n steps.
every_n_secs: Log stats every n seconds.'

def __init__(self, batch_size, every_n_steps=100, every_n_secs=None):

    if ((every_n_steps is None) == (every_n_secs is None)):
        raise ValueError('exactly    one    of    every_n_steps    and    every_n_secs    should    be    provided.')
    self._timer = basic_session_run_hooks.SecondOrStepTimer(every_steps=every_n_steps, every_secs=every_n_secs)
    self._step_train_time = 0
    self._total_steps = 0
    self._batch_size = batch_size
