class_docstr: Information required to execute torch.fx.GraphModule using onnxruntime.InferenceSession
class_docstr_tok: ["Information","required","to","execute","torch.fx.GraphModule","using","onnxruntime.InferenceSession"]
code: def is_supported(self, *args):
      # Compare the args and the input schema in ONNX model and
      # return the first match.
      if len(args) != len(self.input_value_infos):
          return False
      for arg, value_info in zip(args, self.input_value_infos):
          if not isinstance(arg, (torch.Tensor, float, int)):
              return False
  
          # Check Python scalars such as int, float, and bool.
          if isinstance(arg, (int, float, bool)):
              # Map, e.g., float to onnx.TensorProto.FLOAT.
              onnx_dtype = from_python_type_to_onnx_tensor_element_type(
                  type(arg)
              )
              if onnx_dtype != value_info.type.tensor_type.elem_type:
                  return False
              if len(value_info.type.tensor_type.shape.dim) != 0:
                  return False
              continue
  
          # Check tensor.
          onnx_dtype = _TORCH_DTYPE_TO_ONNX_TENSOR_ELEMENT_TYPE[
              arg.dtype
          ]
          if onnx_dtype != value_info.type.tensor_type.elem_type:
              return False
          for dim, onnx_dim in zip(
              arg.shape, value_info.type.tensor_type.shape.dim
          ):
              if isinstance(dim, int) and (
                  onnx_dim.dim_value == dim or onnx_dim.dim_param
              ):
                  continue
              elif isinstance(dim, torch.SymInt) and onnx_dim.dim_param:
                  continue
              else:
                  return False
      return True
  
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 2 for calling the OrtExecutionInfoPerSession obj's underlying member method code with example usage: obj.is_supported() and returns: True, False, False, False, False, False, False