class_docstr: Benchmarks for static optimizations.
class_docstr_tok: ["Benchmarks","for","static","optimizations","."]
code: def _benchmark_filter_fusion(self, chain_length, optimize_dataset):
      dataset = dataset_ops.Dataset.from_tensors(5).repeat(None)
      for _ in range(chain_length):
          dataset = dataset.filter(
              lambda x: math_ops.greater_equal(x - 5, 0)
          )
      if optimize_dataset:
          options = options_lib.Options()
          options.experimental_optimization.apply_default_optimizations = (
              False
          )
          options.experimental_optimization.filter_fusion = True
          dataset = dataset.with_options(options)
  
      opt_mark = "opt" if optimize_dataset else "noopt"
      self.run_and_report_benchmark(
          dataset=dataset,
          num_elements=100,
          iters=10,
          warmup=True,
          extras={
              "model_name": "optimize.benchmark.3",
              "parameters": "%d.%s" % (chain_length, optimize_dataset),
          },
          name="filter_fusion_{}_chain_length_{}".format(
              opt_mark, chain_length
          ),
      )
  
file_path: tensorflow/tensorflow/python/data/experimental/benchmarks/optimize_benchmark.py
imports: from tensorflow.python.data.benchmarks import benchmark_base
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.data.ops import options
  from tensorflow.python.ops import math_ops
label_desc: Use image node_id 6 for calling the OptimizationBenchmark obj's underlying member method code with example usage: obj._benchmark_filter_fusion(chain_length, optimize_dataset) without return types