code: def _run_test_output_match(
      test_suite: onnx_test_common._TestONNXRuntime,
      device: str,
      dtype: torch.dtype,
      op: opinfo_core.OpInfo,
  ):
      # device is provided by instantiate_device_type_tests, but we only want to run in cpu.
      assert device == "cpu"
      samples = op.sample_inputs(
          device,
          dtype,
          requires_grad=False,
      )
      for i, cpu_sample in enumerate(samples):
          inputs = (cpu_sample.input, *cpu_sample.args)
          # Provide the repr to subtest because tensors are not serializable in parallel test runs
  
          with test_suite.subTest(
              opset=test_suite.opset_version,
              sample_num=i,
              inputs=repr(inputs),
              kwargs=repr(cpu_sample.kwargs),
          ):
              test_behavior, reason = _should_skip_xfail_test_sample(
                  op.name,
                  op.variant_test_name,
                  cpu_sample,
                  test_suite.model_type,
              )
              with onnx_test_common.normal_xfail_skip_test_behaviors(
                  test_behavior, reason
              ):
                  model = SingleOpModel(op.op, cpu_sample.kwargs)
                  model.eval()
  
                  if (
                      dtype == torch.float32
                      and op.name in test_suite.fp32_low_precision_dict
                  ):
                      rtol = test_suite.fp32_low_precision_dict[
                          op.name
                      ][0]
                      atol = test_suite.fp32_low_precision_dict[
                          op.name
                      ][1]
                  elif dtype == torch.float32:
                      # Relax atol and rtol for float32 based on empirical results
                      rtol = 1e-5
                      atol = 2e-5
                  elif (
                      dtype == torch.float16
                      and op.name in test_suite.fp16_low_precision_dict
                  ):
                      rtol = test_suite.fp16_low_precision_dict[
                          op.name
                      ][0]
                      atol = test_suite.fp16_low_precision_dict[
                          op.name
                      ][1]
                  else:
                      rtol = None
                      atol = None
  
                  if (
                      test_suite.model_type
                      == pytorch_test_common.TorchModelType.TORCH_EXPORT_EXPORTEDPROGRAM
                  ):
                      try:
                          model = torch.export.export(model, inputs)
                      except AssertionError as e:
                          # TODO: avoid fake_mode detection bug in torch.export.export
                          pytest.xfail(
                              onnx_test_common.reason_dynamo_does_not_support(
                                  str(e)
                              )
                          )
  
                  try:
                      onnx_program = torch.onnx.dynamo_export(
                          model,
                          *inputs,
                      )
                  except torch.onnx.OnnxExporterError as e:
                      # NOTE: If the model has unsupported nodes, we will skip the test
                      # with non-strict xfail. Otherwise, we will raise the error.
                      if hasattr(
                          e.__cause__, "diagnostic"
                      ) and e.__cause__.diagnostic.rule in (
                          _rules._POERules.no_symbolic_function_for_call_function,
                          _rules._POERules.unsupported_fx_node_analysis,
                      ):
                          pytest.xfail(
                              onnx_test_common.reason_onnx_script_does_not_support(
                                  str(e)
                              )
                          )
                      else:
                          raise e
                  _compare_onnx_and_torch_exported_program(
                      model,
                      onnx_program,
                      inputs,
                      rtol=rtol,
                      atol=atol,
                      only_check_shape=(
                          op.name in test_suite.only_shape_check_list
                      ),
                  )
  
imports: from __future__ import annotations
  import copy
  import itertools
  from typing import Any, Callable, Collection, Mapping, Optional, Tuple, Type, Union
  import onnx_test_common
  import parameterized
  import pytest
  import pytorch_test_common
  import torch
  from onnx_test_common import skip, skip_slow, xfail
  from torch.onnx._internal.diagnostics import _rules
  from torch.testing._internal import common_device_type, common_methods_invocations, common_utils
  from torch.testing._internal.opinfo import core
label_desc: Use image node_id 5 for calling a global function with example usage: _run_test_output_match(test_suite, device, dtype, op) without return types