code: def build_engine_without_calib(onnx_model_file, config):
      """
      This function builds an engine from an onnx model following the precisions
      and dynamic range in config without calibrator.
  
      Parameters
      ----------
      onnx_model_file : str
          The path of onnx model
      config : dict
          Config recording bits number and name of layers
  
      Returns
      -------
      tensorrt.ICudaEngine
          An ICudaEngine for executing inference on a built network
      """
      builder = trt.Builder(TRT_LOGGER)
      network = builder.create_network(common.explicit_batch())
      trt_config = builder.create_builder_config()
      parser = trt.OnnxParser(network, TRT_LOGGER)
  
      builder.max_batch_size = 1  # TODO: check whether it is necessary
  
      trt_config.max_workspace_size = common.GiB(4)
  
      trt_config.set_flag(trt.BuilderFlag.INT8)
      trt_config.set_flag(trt.BuilderFlag.FP16)
      trt_config.set_flag(trt.BuilderFlag.PREFER_PRECISION_CONSTRAINTS)
  
      # Parse onnx model
      with open(onnx_model_file, "rb") as model:
          if not parser.parse(model.read()):
              logger.error("ERROR: Fail to parse the ONNX file.")
              for error in range(parser.num_errors):
                  logger.error(parser.get_error(error))
              raise ValueError("Failed to parse the ONNX file.")
  
      config_network_precision(network, config)
  
      # Build engine and do int8 calibration.
      engine = builder.build_engine(network, trt_config)
      return engine
  
imports: import time
  import logging
  import tensorrt
  import numpy
  import torch
  from .None import frontend_to_onnx
  from .None import trt_pycuda
  from .backend import BaseModelSpeedup
label_desc: Use image node_id 7 for calling a global function with example usage: build_engine_without_calib(onnx_model_file, config) and returns: engine