class_docstr: Base class for op benchmarks.
docstr: Runs and reports benchmarks eagerly.
docstr_tok: ["Runs","and","reports","benchmarks","eagerly","."]
code: def _run_and_report_eagerly(
      self,
      fn,
      iters,
      burn_iters,
      benchmark_name,
      xprof_enabled=False,
      **kwargs,
  ):
      """Runs and reports benchmarks eagerly."""
      if self.input_data is None:
          raise ValueError(
              "Input data is missing for {} benchmark".format(
                  benchmark_name
              )
          )
  
      @def_function.function
      def tf_func():
          fn(self.input_data, **kwargs)
  
      def func():
          fn(self.input_data, **kwargs)
  
      op = tf_func if self.use_tf_function else func
  
      for _ in range(burn_iters):
          op()
  
      def run_benchmark():
          total_time = 0
          for _ in range(iters):
              start = time.time()
              op()
              total_time += time.time() - start
  
          return total_time
  
      total_time = run_benchmark()
      mean_time = total_time / iters
      benchmark_name = benchmark_name + (
          "_function" if self.use_tf_function else "_eager"
      )
      metrics = []
      extras = {"sec_per_batch": total_time / iters}
      if hasattr(self, "batch_number"):
          extras.update(
              {"batches_per_sec": self.batch_number / mean_time}
          )
          metrics.append(
              {
                  "name": "batches_per_sec",
                  "value": self.batch_number / mean_time,
              }
          )
  
      if xprof_enabled:
          extras.update(self._run_with_xprof(run_benchmark))
  
      self.report_benchmark(
          wall_time=mean_time,
          name=benchmark_name,
          extras=extras,
          metrics=metrics,
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import time
  import tensorflow
  import tensorflow_datasets
  from tensorflow.python.client import session
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import lookup_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.ops.ragged import ragged_tensor
  from tensorflow_text.python import ops
  from tensorflow.python.util import tf_inspect
label_desc: Use image node_id 7 for calling the OpsBaseBenchmark obj's underlying member method code with example usage: obj._run_and_report_eagerly(fn, iters, burn_iters, benchmark_name, xprof_enabled) and returns: total_time