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","."]
docstr: Runs all sample models based on a key varying parameter.
docstr_tok: ["Runs","all","sample","models","based","on","a","key","varying","parameter","."]
code: def _run_impl(
      self,
      test_name: str,
      default_trt_converter_params: trt.TrtConversionParams,
      trt_converter_params_updater: Callable[
          [trt.TrtConversionParams], Iterable[trt.TrtConversionParams]
      ],
  ) -> None:
      """Runs all sample models based on a key varying parameter."""
      for model_config in self._configs:
          # Loads, compiles, calibrates and runs models.
          manager = self._model_handler_manager_cls(
              name=test_name,
              model_config=model_config,
              default_trt_convert_params=default_trt_converter_params,
              trt_convert_params_updater=trt_converter_params_updater,
          )
          inputs = manager.generate_random_inputs()
          # As all the data are randomly generated, directly use inference data as
          # calibration data to produce reliable dynamic ranges.
          manager.convert(inputs)
          test_results = manager.run(inputs)
  
          # Analyzes the latency and numerical results.
          analysis_result_df, _, acc_hist = self._analyzer.analysis(
              test_results
          )
  
          # Outputs the analysis results
          model_name = os.path.split(
              manager.model_config.saved_model_dir
          )[-1]
          model_dir = os.path.join(self._output_dir, model_name)
          gfile.MkDir(model_dir)
          test_dir = os.path.join(model_dir, test_name)
          gfile.MkDir(test_dir)
          with gfile.Open(
              os.path.join(test_dir, "default_tensorrt_params.txt"), "w"
          ) as f:
              f.write(repr(default_trt_converter_params))
          with gfile.Open(
              os.path.join(test_dir, "accuracy_histograms.txt"), "w"
          ) as f:
              [f.write(h) for h in acc_hist]
          self._write_analysis_result(analysis_result_df, test_dir)
  
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 3 for calling the SampleRunner obj's underlying member method code with example usage: obj._run_impl(test_name, default_trt_converter_params, trt_converter_params_updater) without return types