class_docstr: Benchmarks for `tf.data.experimental.snapshot()`.
class_docstr_tok: ["Benchmarks","for","`","tf.data.experimental.snapshot","(",")","`","."]
code: def benchmarkWriteSnapshotSimple(self):
      num_elements = 500000
      dataset = self._createSimpleDataset(num_elements=num_elements)
  
      # We only run one iteration here because running multiple iterations will
      # cause the later iterations to simply read from the already written
      # snapshot rather than write a new one.
      self.run_and_report_benchmark(
          dataset=dataset,
          num_elements=num_elements,
          name="write_simple",
          warmup=False,
          extras={
              "model_name": "snapshot.benchmark.3",
              "parameters": "%d" % num_elements,
          },
          iters=1,
      )
  
file_path: tensorflow/tensorflow/python/data/experimental/benchmarks/snapshot_dataset_benchmark.py
imports: import os
  import shutil
  from tensorflow.python.data.benchmarks import benchmark_base
  from tensorflow.python.data.experimental.ops import snapshot
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.ops import gen_array_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 5 for calling the SnapshotDatasetBenchmark obj's underlying member method code with example usage: obj.benchmarkWriteSnapshotSimple() without return types