class_docstr: Checks the runtime performance of outputting all intermediates.
class_docstr_tok: ["Checks","the","runtime","performance","of","outputting","all","intermediates","."]
docstr: Benchmarks cond in a defun.
docstr_tok: ["Benchmarks","cond","in","a","defun","."]
code: def _benchmark_defun(self):
      """Benchmarks cond in a defun."""
  
      @def_function.function
      def cond_fn(x):
          return self._create_cond(x)
  
      # Warm up
      for _ in range(self.NUM_WARM_UP_ITERS):
          cond_fn(0.0)
  
      start_time = time.time()
  
      for _ in range(self.NUM_ITERS):
          cond_fn(0.0)
  
      self.report_benchmark(
          wall_time=time.time() - start_time, iters=self.NUM_ITERS
      )
  
imports: import time
  from tensorflow.python.client import session
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import cond
  from tensorflow.python.ops import control_flow_util
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 2 for calling the CondWithManyIntermediatesBenchmark obj's underlying member method code with example usage: obj._benchmark_defun() and returns: self