code: def load_quantized_bert_base(batch_size=1, seq_len=384):
      """
      Load the quantized bert-base model from TLCBench, possibly downloading it from github
      and caching the converted int8 QNN module to disk.
  
      In addition to returing the relay module and its parameters, it also returns input name
      and shape information, which can be used at the deployment time as follows:
  
      ```
      mod, params, input_info = load_quantized_bert_base()
  
      ...
  
      runtime = tvm.contrib.graph_executor.GraphModule(lib["default"](dev))
  
      for name, shape in input_info:
          arr = np.random.uniform(1, 10, size=shape).astype("int64")
          runtime.set_input(name, arr)
  
      runtime.run()
      ```
  
      """
      url = "https://github.com/tlc-pack/TLCBench/raw/main/models/bert-base-qat.onnx"
      log.info("Downloading quantized bert-base model.")
      onnx_path = download_testdata(
          url, "bert-base-qat.onnx", module="tlcbench"
      )
      data_dir = os.path.dirname(onnx_path)
  
      json_path = os.path.join(
          data_dir,
          "bert_base_int8_b%d_s%d.json" % (batch_size, seq_len),
      )
      params_path = os.path.join(
          data_dir,
          "bert_base_int8_b%d_s%d.params" % (batch_size, seq_len),
      )
  
      # Input names and order encoded in the ONNX model
      input_info = [
          ("input_ids", (batch_size, seq_len)),
          ("segment_ids", (batch_size, seq_len)),
          ("input_mask", (batch_size, seq_len)),
      ]
  
      if not os.path.exists(json_path) or not os.path.exists(
          params_path
      ):
          convert_to_qnn(onnx_path, json_path, params_path, input_info)
  
      def deserialize():
          try:
              return deserialize_relay(json_path, params_path)
          except ValueError:
              # A serialized Relay json file may become invalid after TVM bump
              # Update the serialized model and try loading again
              convert_to_qnn(
                  onnx_path, json_path, params_path, input_info
              )
              return deserialize_relay(json_path, params_path)
  
      mod, params = deserialize()
  
      return mod, params, input_info
  
file_path: tvm/python/tvm/meta_schedule/testing/tlcbench.py
imports: import logging
  import multiprocessing
  import os
  import tvm
  from tvm import relay
  from tvm.contrib.download import download_testdata
label_desc: Use image node_id 4 for calling a global function with example usage: load_quantized_bert_base(batch_size, seq_len) and returns: mod,  params,  input_info, deserialize_relay, deserialize_relay