class_docstr: Common methods used in PerfZero Benchmarks.
  
  Handles the resetting of flags between tests. PerfZero (OSS) runs each test
  in a separate process reducing some need to reset the flags.
class_docstr_tok: ["Common","methods","used","in","PerfZero","Benchmarks",".","Handles","the","resetting","of","flags","between","tests",".","PerfZero","(","OSS",")","runs","each","test","in","a","separate","process","reducing","some","need","to","reset","the","flags","."]
docstr: Initialize class.
  
  Args:
    output_dir: Base directory to store all output for the test.
docstr_tok: ["Initialize","class",".","Args",":","output_dir",":","Base","directory","to","store","all","output","for","the","test","."]
code: def __init__(self, output_dir=None):
      """Initialize class.
  
      Args:
        output_dir: Base directory to store all output for the test.
      """
      # MLCompass sets this value, but PerfZero OSS passes it as an arg.
      if os.getenv("BENCHMARK_OUTPUT_DIR"):
          self.output_dir = os.getenv("BENCHMARK_OUTPUT_DIR")
      elif output_dir:
          self.output_dir = output_dir
      else:
          self.output_dir = "/tmp"
  
file_path: agents/tf_agents/benchmark/perfzero_benchmark.py
imports: import os
  from typing import Optional, Union
  from absl import flags
  from absl import logging
  from absl.testing import flagsaver
  import tensorflow
label_desc: Use image node_id 1 to create a new PerfZeroBenchmark object from inherited base classes: tf.test with example: obj = PerfZeroBenchmark(output_dir)