class_docstr: Benchmarks for `tf.data.Dataset.map()`.
class_docstr_tok: ["Benchmarks","for","`","tf.data.Dataset.map","(",")","`","."]
code: def benchmark_parallel_control_flow(self):
      dataset = dataset_ops.Dataset.from_tensors(
          random_ops.random_uniform([100, 10000000])
      )
  
      def fn(x):
          return map_fn.map_fn(
              lambda y: y * array_ops.transpose(y),
              x,
              parallel_iterations=10,
          )
  
      num_elements = 1
      dataset = dataset.map(fn)
      self.run_and_report_benchmark(
          dataset,
          num_elements=1,
          extras={
              "model_name": "map.benchmark.9",
              "parameters": "%d" % num_elements,
          },
          name="parallel_control_flow",
          apply_default_optimizations=True,
      )
  
file_path: tensorflow/tensorflow/python/data/benchmarks/map_benchmark.py
imports: import numpy
  from tensorflow.python.data.benchmarks import benchmark_base
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.data.ops import map_op
  from tensorflow.python.framework import constant_op
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import map_fn
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops import while_loop
label_desc: Use image node_id 4 for calling the MapBenchmark obj's underlying member method code with example usage: obj.benchmark_parallel_control_flow() and returns: map_fn