class_docstr: Base class for dataset benchmarks.
class_docstr_tok: ["Base","class","for","dataset","benchmarks","."]
docstr: Benchmark the iterable in eager mode.
  
  Runs the iterable `iters` times. In each iteration, the benchmark measures
  the time it takes to go execute the iterable.
  
  Args:
    iterable: The tf op or tf.data Dataset to benchmark.
    iters: Number of times to repeat the timing.
    warmup: If true, warms up the session caches by running an untimed run.
  
  Returns:
    A float, representing the median time (with respect to `iters`)
    it takes for the iterable to be executed `iters` num of times.
  
  Raises:
    RuntimeError: When executed in graph mode.
docstr_tok: ["Benchmark","the","iterable","in","eager","mode",".","Runs","the","iterable","`","iters","`","times",".","In","each","iteration",",","the","benchmark","measures","the","time","it","takes","to","go","execute","the","iterable",".","Args",":","iterable",":","The","tf","op","or","tf.data","Dataset","to","benchmark",".","iters",":","Number","of","times","to","repeat","the","timing",".","warmup",":","If","true",",","warms","up","the","session","caches","by","running","an","untimed","run",".","Returns",":","A","float",",","representing","the","median","time","(","with","respect","to","`","iters","`",")","it","takes","for","the","iterable","to","be","executed","`","iters","`","num","of","times",".","Raises",":","RuntimeError",":","When","executed","in","graph","mode","."]
code: def _run_eager_benchmark(self, iterable, iters, warmup):
      """Benchmark the iterable in eager mode.
  
      Runs the iterable `iters` times. In each iteration, the benchmark measures
      the time it takes to go execute the iterable.
  
      Args:
        iterable: The tf op or tf.data Dataset to benchmark.
        iters: Number of times to repeat the timing.
        warmup: If true, warms up the session caches by running an untimed run.
  
      Returns:
        A float, representing the median time (with respect to `iters`)
        it takes for the iterable to be executed `iters` num of times.
  
      Raises:
        RuntimeError: When executed in graph mode.
      """
  
      deltas = []
      if not context.executing_eagerly():
          raise RuntimeError(
              "Eager mode benchmarking is not supported in graph mode."
          )
  
      for _ in range(iters):
          if warmup:
              iterator = iter(iterable)
              next(iterator)
  
          iterator = iter(iterable)
          start = time.time()
          next(iterator)
          end = time.time()
          deltas.append(end - start)
      return np.median(deltas)
  
file_path: tensorflow/tensorflow/python/data/benchmarks/benchmark_base.py
imports: import time
  import numpy
  from tensorflow.python.client import session
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.data.ops import options
  from tensorflow.python.data.util import nest
  from tensorflow.python.eager import context
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling the DatasetBenchmarkBase obj's underlying member method code with example usage: obj._run_eager_benchmark(iterable, iters, warmup) and returns: np