class_docstr: Run hook used by the evaluation routines to run the `eval_ops` N times.
class_docstr_tok: ["Run","hook","used","by","the","evaluation","routines","to","run","the","`","eval_ops","`","N","times","."]
docstr: Constructs the run hook.
  
  Args:
    num_evals: The number of evaluations to run for. if set to None, will
      iterate the dataset until all inputs are exhausted.
    log_progress: Whether to log evaluation progress, defaults to True.
docstr_tok: ["Constructs","the","run","hook",".","Args",":","num_evals",":","The","number","of","evaluations","to","run","for",".","if","set","to","None",",","will","iterate","the","dataset","until","all","inputs","are","exhausted",".","log_progress",":","Whether","to","log","evaluation","progress",",","defaults","to","True","."]
code: def __init__(self, num_evals, log_progress=True):
      """Constructs the run hook.
  
      Args:
        num_evals: The number of evaluations to run for. if set to None, will
          iterate the dataset until all inputs are exhausted.
        log_progress: Whether to log evaluation progress, defaults to True.
      """
      # The number of evals to run for.
      self._num_evals = num_evals
      self._evals_completed = None
      self._log_progress = log_progress
      # Reduce logging frequency if there are 20 or more evaluations.
      self._log_frequency = (
          1
          if (num_evals is None or num_evals < 20)
          else math.floor(num_evals / 10.0)
      )
  
imports: import math
  import time
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import init_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import state_ops
  from tensorflow.python.ops import variable_scope
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.training import basic_session_run_hooks
  from tensorflow.python.training import monitored_session
  from tensorflow.python.training import session_run_hook
label_desc: Use image node_id 1 to create a new _StopAfterNEvalsHook object from inherited base classes: session_run_hook with example: obj = _StopAfterNEvalsHook(num_evals, log_progress)