class_docstr: Benchmarks for `tf.data.Dataset.unbatch()`.
class_docstr_tok: ["Benchmarks","for","`","tf.data.Dataset.unbatch","(",")","`","."]
code: def benchmark_old_unbatch_implementation(self):
      batch_sizes = [1, 2, 5, 10, 20, 50]
      num_elements = 10000
  
      for batch_size in batch_sizes:
          dataset = dataset_ops.Dataset.from_tensors("element").repeat(
              None
          )
          dataset = dataset.batch(batch_size)
          dataset = dataset.flat_map(
              dataset_ops.Dataset.from_tensor_slices
          )
  
          self.run_and_report_benchmark(
              dataset=dataset,
              num_elements=num_elements,
              iters=5,
              extras={
                  "model_name": "unbatch.benchmark.2",
                  "parameters": "%d" % batch_size,
              },
              name="unfused_batch_size_%d" % batch_size,
          )
  
imports: from tensorflow.python.data.benchmarks import benchmark_base
  from tensorflow.python.data.ops import dataset_ops
label_desc: Use image node_id 2 for calling the UnbatchBenchmark obj's underlying member method code with example usage: obj.benchmark_old_unbatch_implementation() without return types