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 legacy graph mode.
docstr_tok: ["Benchmarks","cond","in","legacy","graph","mode","."]
code: def _benchmark_graph(self):
      """Benchmarks cond in legacy graph mode."""
      with context.graph_mode():
          with ops.Graph().as_default():
              x = array_ops.placeholder(dtypes.float32)
              cond_val = self._create_cond(x)
  
              with session.Session() as sess:
                  cond_fn = sess.make_callable(cond_val, [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 3 for calling the CondWithManyIntermediatesBenchmark obj's underlying member method code with example usage: obj._benchmark_graph() without return types