code: def test_models_onnx_export(arch_name, input_shape, output_size):
      # Model
      batch_size = 2
      model = detection.__dict__[arch_name](
          pretrained=True, exportable=True
      ).eval()
      dummy_input = torch.rand(
          (batch_size, *input_shape), dtype=torch.float32
      )
      with tempfile.TemporaryDirectory() as tmpdir:
          # Export
          model_path = export_model_to_onnx(
              model,
              model_name=os.path.join(tmpdir, "model"),
              dummy_input=dummy_input,
          )
          assert os.path.exists(model_path)
          # Inference
          ort_session = onnxruntime.InferenceSession(
              os.path.join(tmpdir, "model.onnx"),
              providers=["CPUExecutionProvider"],
          )
          ort_outs = ort_session.run(
              ["logits"], {"input": dummy_input.numpy()}
          )
          assert isinstance(ort_outs, list) and len(ort_outs) == 1
          assert ort_outs[0].shape == (batch_size, *output_size)
  
file_path: doctr/tests/pytorch/test_models_detection_pt.py
imports: import os
  import tempfile
  import numpy
  import onnxruntime
  import pytest
  import torch
  from doctr.file_utils import CLASS_NAME
  from doctr.models import detection
  from doctr.models.detection._utils import dilate, erode
  from doctr.models.detection.predictor import DetectionPredictor
  from doctr.models.utils import export_model_to_onnx
label_desc: Use image node_id 5 for calling a global function with example usage: test_models_onnx_export(arch_name, input_shape, output_size) without return types