class_docstr: Hook to print out examples per second.
  
  Total time is tracked and then divided by the total number of steps
  to get the average step time and then batch_size is used to determine
  the running average of examples per second. The examples per second for the
  most recent interval is also logged.
class_docstr_tok: ["Hook","to","print","out","examples","per","second",".","Total","time","is","tracked","and","then","divided","by","the","total","number","of","steps","to","get","the","average","step","time","and","then","batch_size","is","used","to","determine","the","running","average","of","examples","per","second",".","The","examples","per","second","for","the","most","recent","interval","is","also","logged","."]
docstr: 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.
docstr_tok: ["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","."]
code: def __init__(
      self,
      batch_size,
      every_n_steps=100,
      every_n_secs=None,
  ):
      """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.
      """
      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
  
imports: import collections
  import six
  import tensorflow
  from tensorflow.python.platform import tf_logging
  from tensorflow.core.framework import node_def_pb2
  from tensorflow.python.framework import device
  from tensorflow.python.training import basic_session_run_hooks
  from tensorflow.python.training import session_run_hook
  from tensorflow.python.training import training_util
  from tensorflow.python.training import device_setter
  from tensorflow.contrib.learn.python.learn import run_config
label_desc: Use image node_id 1 to create a new ExamplesPerSecondHook object from inherited base classes: session_run_hook with example: obj = ExamplesPerSecondHook(batch_size, every_n_steps, every_n_secs)