def _benchmark(self, dataset_fn, iters, num_elements):
    with ops.Graph().as_default():
        options = dataset_ops.Options()
        options.experimental_optimization.apply_default_optimizations = False
        dataset = dataset_fn().with_options(options)
        next_element = dataset_ops.make_one_shot_iterator(dataset).get_next()
        with session.Session() as sess:
            deltas = []
            for _ in range(iters):
                start = time.time()
                for _ in range(num_elements):
                    sess.run(next_element.op)
                end = time.time()
                deltas.append((end - start))
    mean_wall_time = (np.mean(deltas) / num_elements)
    self.report_benchmark(iters=iters, wall_time=mean_wall_time)
def _benchmark(self, dataset_fn, iters, num_elements):
    with ops.Graph().as_default():
        options = dataset_ops.Options()
        options.experimental_optimization.apply_default_optimizations = False
        dataset = dataset_fn().with_options(options)
        next_element = dataset_ops.make_one_shot_iterator(dataset).get_next()
        with session.Session() as sess:
            deltas = []
            for _ in range(iters):
                start = time.time()
                for _ in range(num_elements):
                    sess.run(next_element.op)
                end = time.time()
                deltas.append((end - start))
    mean_wall_time = (np.mean(deltas) / num_elements)
    self.report_benchmark(iters=iters, wall_time=mean_wall_time)