class_docstr: The driver to run all sample models in all specified configurations.
class_docstr_tok: ["The","driver","to","run","all","sample","models","in","all","specified","configurations","."]
code: def __init__(
      self,
      saved_model_dir: str,
      saved_model_tags: Sequence[str],
      saved_model_signature_key: str,
      batch_size: int,
      output_dir: str,
      output_format: str,
      use_tf2: bool,
      use_int8: bool,
      analyzer: result_analyzer.ResultAnalyzer,
  ):
      self._output_dir = output_dir or tempfile.mkdtemp(
          prefix="tf2trt_model_tests"
      )
      logging.info("Use output directory as: %s", self._output_dir)
      self._output_format = output_format
      # The model_configs contains (saved_model_dir, saved_model_signature_key,
      # batch_size) for each model
      self._configs = (
          model_handler.ModelConfig(
              saved_model_dir=saved_model_dir,
              saved_model_tags=tuple(saved_model_tags),
              saved_model_signature_key=saved_model_signature_key,
              default_batch_size=batch_size,
          ),
      )
      self._model_handler_manager_cls = (
          model_handler.ModelHandlerManagerV2
          if use_tf2
          else model_handler.ModelHandlerManagerV1
      )
  
      if use_int8:
          self._precision_modes = [
              trt.TrtPrecisionMode.FP32,
              trt.TrtPrecisionMode.FP16,
              trt.TrtPrecisionMode.INT8,
          ]
      else:
          self._precision_modes = [
              trt.TrtPrecisionMode.FP32,
              trt.TrtPrecisionMode.FP16,
          ]
  
      self._analyzer = analyzer
  
imports: import functools
  import os
  import tempfile
  from typing import Callable, Iterable, Sequence
  from collections import namedtuple
  from absl import app
  from absl import flags
  from tensorflow.python.compiler.tensorrt import trt_convert
  from tensorflow.python.compiler.tensorrt.model_tests import model_handler
  from tensorflow.python.compiler.tensorrt.model_tests import result_analyzer
  from tensorflow.python.eager import context
  from tensorflow.python.framework import config
  from tensorflow.python.framework import ops
  from tensorflow.python.platform import gfile
  from tensorflow.python.platform import test
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.saved_model import signature_constants
  from tensorflow.python.saved_model import tag_constants
label_desc: Use image node_id 1 to create a new SampleRunner object from inherited base classes: object with example: obj = SampleRunner(saved_model_dir, saved_model_tags, saved_model_signature_key, batch_size, output_dir, output_format, use_tf2, use_int8, analyzer)