class_docstr: Benchmarks for reductions.
class_docstr_tok: ["Benchmarks","for","reductions","."]
code: def _run(self, func, num_iters):
      # call func to maybe warm up the GPU
      func()
      start = time.time()
      for _ in range(num_iters):
          func()
      end = time.time()
      mean_us = (end - start) * 1e6 / num_iters
      self.report_benchmark(
          iters=num_iters,
          wall_time=mean_us,
          extras={"examples_per_sec": num_iters / (end - start)},
      )
  
file_path: tensorflow/tensorflow/python/kernel_tests/math_ops/reduce_benchmark_test.py
imports: import time
  import numpy
  from tensorflow.core.protobuf import config_pb2
  from tensorflow.python.client import session
  from tensorflow.python.eager import backprop
  from tensorflow.python.eager import context
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gradients_impl
  from tensorflow.python.ops import math_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling the ReduceBenchmarks obj's underlying member method code with example usage: obj._run(func, num_iters) without return types