code: def _run_onnx_session_with_fetch(
      sess: "onnxruntime.InferenceSession",
      input_names: Tuple[str, ...],
      inputs: Tuple[torch.Tensor, ...],
      input_devices: Tuple["ORTC.OrtDevice", ...],
      output_names: Tuple[str, ...],
      outputs: Tuple[torch.Tensor, ...],
      output_devices: Tuple["ORTC.OrtDevice", ...],
      preallocate_output: bool,
      input_value_infos: Tuple["onnx.ValueInfoProto", ...],  # type: ignore[name-defined]
      normalized_prim_outputs: Tuple[
          Union[
              torch.Tensor,
              torch.SymInt,
              int,
              torch.SymFloat,
              float,
              torch.SymBool,
              bool,
          ],
          ...,
      ],
  ) -> Tuple[Union[torch.Tensor, int, float, bool], ...]:
      inputs = tuple(
          _adjust_scalar_from_fx_to_onnx(arg, value_info)
          for arg, value_info in zip(inputs, input_value_infos)
      )
      feed = {
          name: onnxruntime.OrtValue.ortvalue_from_numpy(
              tensor.cpu().numpy()
          )
          for name, tensor in zip(input_names, inputs)
      }
      ort_outputs = sess.run(output_names, feed)
      pth_outputs = tuple(
          _adjust_scalar_from_onnx_to_fx(
              torch.from_numpy(value),
              prim_output,
          )
          for value, prim_output in zip(
              ort_outputs, normalized_prim_outputs
          )
      )
      return pth_outputs
  
imports: import dataclasses
  import importlib
  import logging
  from typing import Any, Dict, Final, List, Mapping, Optional, Sequence, Set, Tuple, Union
  from typing_extensions import TypeAlias
  import torch
  import torch._C
  import torch._ops
  import torch._prims.executor
  import torch.fx
  from torch._subclasses.fake_tensor import FakeTensor
  from torch.fx._compatibility import compatibility
  from torch.fx.passes.fake_tensor_prop import FakeTensorProp
  from torch.fx.passes.operator_support import OperatorSupport
  from torch.fx.passes.tools_common import CALLABLE_NODE_OPS
  from torch.utils import _pytree
label_desc: Use image node_id 18 for calling a global function with example usage: _run_onnx_session_with_fetch(sess, input_names, inputs, input_devices, output_names, outputs, output_devices, preallocate_output, input_value_infos, normalized_prim_outputs) and returns: pth_outputs